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§
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 examplevalidate_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 currentactix_session
this will be valid ifgenerate_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.