Working on access/refresh tokens

This commit is contained in:
Benjamin Sherriff
2023-10-18 14:24:50 -04:00
parent d245e41978
commit 7ba0e070ac
7 changed files with 277 additions and 80 deletions

View File

@@ -100,6 +100,18 @@ impl From<argon2::password_hash::Error> for ServiceError {
}
}
impl From<jsonwebtoken::errors::Error> for ServiceError {
fn from(error: jsonwebtoken::errors::Error) -> ServiceError {
ServiceError::new(500, format!("Unknown jsonwebtoken error: {}", error))
}
}
impl From<redis::RedisError> for ServiceError {
fn from(error: redis::RedisError) -> ServiceError {
ServiceError::new(500, format!("Unknown redis error: {}", error))
}
}
impl ResponseError for ServiceError {
fn error_response(&self) -> HttpResponse {
let status_code = match StatusCode::from_u16(self.status) {