SiteLoginController

struct SiteLoginController : SiteControllerUtils

Login

  • Declaration

    Swift

    struct LoginPageContext : Encodable
  • Declaration

    Swift

    struct UserCreatedContext : Encodable
  • GET /login GET /logout

    When the caller is a logged-in user with a session token, this shows a logout page. When the caller is not logged-in, this shows a login page.

    Declaration

    Swift

    func loginPageViewHandler(_ req: Request) async throws -> View
  • POST /login

    See more

    Declaration

    Swift

    func loginPagePostHandler(_ req: Request) async throws -> View
  • POST /logout

    ** Form Submission Parameters**

    • allaccounts=true - Logs the user out of all sessions by removing the user’s auth token.

    There’s a single URL for login/logout; it shows you the right page depending on your current login status. The logout form shows the user who they’re logged in as, and has a single ‘Logout’ button.

    See more

    Declaration

    Swift

    func loginPageLogoutHandler(_ req: Request) async throws -> View
  • GET /createAccount

    Shows the Account Creation form if not logged in. For logged-in users this shows the Logout form.

    Declaration

    Swift

    func createAccountPageHandler(_ req: Request) async throws -> View
  • POST /createAccount

    Called when the Create Account form is POSTed.

    See more

    Declaration

    Swift

    func createAccountPostHandler(_ req: Request) async throws -> View
  • GET /resetPassword

    Shows the Reset Password page. Uses password update if you’re logged in, else uses the recover password flow.

    Declaration

    Swift

    func resetPasswordViewHandler(_ req: Request) async throws -> View
  • POST /resetPassword

    See more

    Declaration

    Swift

    func resetPasswordPostHandler(_ req: Request) async throws -> View
  • POST /recoverPassword

    Change password for logged-out user, using regcode, current password, or recovery code.

    See more

    Declaration

    Swift

    func recoverPasswordPostHandler(_ req: Request) async throws -> View
  • GET /codeOfConduct GET /conductAgree

    See more

    Declaration

    Swift

    func codeOfConductViewHandler(_ req: Request) async throws -> View
  • GET /createAltAccount

    Must be logged in, although you can be logged in as an alt account, in which case this method creates another alt as a child of the parent account. All accounts are parents or children, never both.

    Declaration

    Swift

    func createAltAccountViewHandler(_ req: Request) async throws -> View
  • POST /createAltAccount

    See more

    Declaration

    Swift

    func createAltAccountPostHandler(_ req: Request) async throws -> View

Utilities