Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create a Session in Amatino Swift. This is analogous to "logging in" to the Amatino API
// Amatino Swift: https://github.com/amatino-code/amatino-swift
// Double entry accounting API
try Session.create(
email: "clever@cookie.com",
secret: "high entropy passphrase",
callback: { (error, session) in
guard error == nil else {
// Handle errors. In particular, look out for 401, which
// would indicate invalid credentials such as a mistyped
// passphrase.
}
// Store the session somewhere for use with later requests.
print("Created new Session with ID: \(session.id)")
return
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.