Function iqps_backend::auth::authenticate_user
source · pub async fn authenticate_user(
code: &String,
env_vars: &EnvVars,
) -> Result<Option<String>, Error>
Expand description
Takes a Github OAuth code and creates a JWT authentication token for the user
- Uses the OAuth code to get an access token.
- Uses the access token to get the user’s username.
- Uses the username and and a admin’s access token to verify whether the user is a member of the admins github team.
Returns the JWT if the user is authenticated, None
otherwise.