Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MagicCodeCache = initCache(300) //5 minute expiry
MagicCodeCache is the cache for storing email/temp pw combinations for passwordless authorisation
Functions ¶
func Authorizator ¶
This is the first level of authorisation: The JWT contains the userId. We look this up in the users table in the database and if found attach the specified role. If nothing is found, we default to anon Beyond this, we do not know anything about database privelages - this is handled further down the line
func GetUserToken ¶
GetUserToken returns a JWT string encoded with a user id
func RequestMagicCode ¶
RequestMagicCode generates a magic code, stores it in the cache against the user's email and sends it to them by email
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.