Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
SESSIONMANAGER
is a signature for a functor producing modules for controlling sessions and authentications of entities with type MODEL.t
type entity
is a type of authenticatable entity equal to MODEL.t
val auth_setup : Dream.middleware
auth_setup
is a middleware which controlls session, setups field
variables and helper functions for downstream handlers
auth_setup
tries to extract auth
string from session and determine the status of authentication. If there is no auth
, then there were no authentication. If auth
exisits, than set_helpers
checks it and manages authentication status. If something is wrong with a session, Error Error.t
is returned, and in this case session is invalidated, error is logged and 401 is sent. If session is ok, Ok request
is recived, and that requested is passed on.