Skip to content

Improved Session Storage

Compare
Choose a tag to compare
@edjiang edjiang released this 30 Aug 06:01
· 69 commits to master since this release

Improved session storage so that Turnstile works with more than just in-memory stores

  • Subjects can auto-initialize from a Session via Subject(turnstile:sessionID:)
  • An empty struct, Session is a credential type for Subjects initialized with a SessionID
  • Accounts now only have a uniqueID, which is an ID that needs to be unique within its realm. The Realm.type requirement has been dropped.
  • SessionManager.getSubject(identifier:) throws -> Subject is now SessionManager.restoreAccount(fromSessionID:) throws -> Account
  • createSession(user:) -> String is now createSession(account:) -> String