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

  1. Uses the OAuth code to get an access token.
  2. Uses the access token to get the user’s username.
  3. 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.