polysemy-account-api-0.2.0.0: Account management with Servant and Polysemy
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Account.Api.Server.Auth

Description

 
Synopsis

Documentation

authAccount :: Members [Accounts i p !! AccountsError, Log, Stop ServerError] r => AuthResult (AuthedAccount i p) -> Sem r (AuthedAccount i p) Source #

Authenticate an account using the JSON Web Token extracted by Servant.

login :: forall e i p r. Show e => Members [Jwt (AuthedAccount i p) !! e, Accounts i p !! AccountsError, Log, Stop ServerError] r => AccountCredentials -> Sem r AuthToken Source #

Log an account in using the credentials in the payload.

register :: Show e => Members [Jwt (AuthedAccount i p) !! e, Accounts i p !! AccountsError, Log, Stop ServerError] r => AccountCredentials -> Sem r AuthToken Source #

Register an account using the credentials in the payload.