tsk-51: Saving changes
Some checks failed
Rust Build / Rustfmt (pull_request) Successful in 31s
Rust Build / Check (pull_request) Failing after 54s
Rust Build / Test Suite (pull_request) Failing after 38s
Rust Build / Clippy (pull_request) Failing after 41s
Rust Build / build (pull_request) Failing after 56s
Some checks failed
Rust Build / Rustfmt (pull_request) Successful in 31s
Rust Build / Check (pull_request) Failing after 54s
Rust Build / Test Suite (pull_request) Failing after 38s
Rust Build / Clippy (pull_request) Failing after 41s
Rust Build / build (pull_request) Failing after 56s
Adding more functions to access and validate the token type
This commit is contained in:
@@ -165,7 +165,15 @@ pub mod endpoint {
|
||||
// * Check token type
|
||||
// - For right now, just worry about service tokens
|
||||
// * Create a new token with a longer expiration
|
||||
(axum::http::StatusCode::OK, axum::Json(response))
|
||||
let token_type = token_stuff::get_token_type(&key, &payload.access_token).unwrap();
|
||||
|
||||
if token_stuff::is_token_type_valid(&token_type) {
|
||||
// let (token_literal, dur) = token_stuff::create_service_refresh_token(&key, )
|
||||
(axum::http::StatusCode::OK, axum::Json(response))
|
||||
} else {
|
||||
response.message = String::from("Invalid token type");
|
||||
(axum::http::StatusCode::NOT_FOUND, axum::Json(response))
|
||||
}
|
||||
} else {
|
||||
response.message = String::from("Could not verify token");
|
||||
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
|
||||
|
Reference in New Issue
Block a user