Crate rocket_auth_token[][src]

Expand description

Auth token and credentials helper for your rocket web api. This is a basic token generator crate for Rust Rocket Web. let credentials = AuthCredentials{email: “email”, password: “password”}, use hasher(credentials) function to generate AuthToken for user on login, user then need to supply Authorization token as header when making request from server using rocket request guard, grab the auth token and decode with decode_hasher and return ok() if credentials is corrrect!

Structs

AuthCredentials to be encoded into AuthToken and vice-versa

AuthToken is to be passed into Authorization header after encoding user credentials

Functions

Decode passed AuthToken and return AuthCredentials

Encode AuthCredentials into base64 encoded string and return AuthToken