Better Error Logging for Generating Token
All checks were successful
Build and Push Image / spfn-website (push) Successful in 3m18s
All checks were successful
Build and Push Image / spfn-website (push) Successful in 3m18s
This commit is contained in:
parent
1c855b7faa
commit
39211cefe9
1 changed files with 5 additions and 2 deletions
|
|
@ -40,7 +40,7 @@ async fn gen_token(Json(payload): Json<GenerateTokenRequest>) -> Result<Json<Tok
|
|||
let client_secret = match env::var("ACCOUNT_CLIENT_SECRET") {
|
||||
Ok(secret) => secret,
|
||||
Err(_) => {
|
||||
println!("No account client secret specified - Token generation will always fail");
|
||||
println!("[/api/v1/login/generate_token] No account client secret specified - Token generation will always fail");
|
||||
return Err(StatusCode::INTERNAL_SERVER_ERROR)
|
||||
},
|
||||
};
|
||||
|
|
@ -65,7 +65,10 @@ async fn gen_token(Json(payload): Json<GenerateTokenRequest>) -> Result<Json<Tok
|
|||
|
||||
match body {
|
||||
Ok(b) => return Ok(Json(b)),
|
||||
Err(_) => return Err(StatusCode::BAD_GATEWAY)
|
||||
Err(e) => {
|
||||
println!("[/api/v1/login/generate_token] Failed to parse token data from upstream: {}", e);
|
||||
return Err(StatusCode::BAD_GATEWAY)
|
||||
},
|
||||
};
|
||||
},
|
||||
Err(e) => match e.status() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue