Module session

Source
Expand description

Provides function wrappers around the auth module which are ready to be used as endpoints in actix web. Made to interact with a actix_session session. Mainly this is only needed for session management. User creation is not effected. This should be more easily used inside other projects. As long as a session is present. This saves you from needing to build your own wrappers around actix session or managing cookies yourself.

SECURITY NOTE: The session token will be stored on the client side in a cookie. The cookies should have the max security possible. This can be configured when creating the actix_session wrapper.

Note that this only provides functions relating to sessions. These functions can be used at the top of your own functions to check if a session is valid. However note that for the most part if you need to for example add a user (dose not relate to sessions) you should use auth::add_user() or wrappers::add_user() if you want a endpoint you can tie to.

Enums§

EndSessionsReturn
GenerateSessionReturn
ValidatedSessionReturn

Functions§

end_sessions
end_sessions_web_resp
generate_session
generate_session will create a auth session based on the provided credentials and add it to the actix_session. This auth session can now be checked on subsequent calls to for example validate_session
generate_session_web_resp
Validate session using the given session but will return a type compatible with actix web responder.
validate_session
validate_session will check the session stored in the current actix_session this will be valid if generate_session was call prior and set up a auth session. Assuming the auth session is not invalid
validate_session_web_resp
Validate session using the given session but will return a type compatible with actix web responder.