next_web_dev/util/
security_util.rs

1// use axum::{extract::Request, http::header};
2
3// use super::token_util::TokenUtil;
4
5// pub struct SecurityUtil;
6
7// impl SecurityUtil {
8//     pub fn get_token(req: &Request) -> Option<String> {
9//         req.headers().get(header::AUTHORIZATION).map(|auth| {
10//             auth.to_str()
11//                 .map(|token| token.replace("Bearer ", ""))
12//                 .unwrap_or_default()
13//         })
14//     }
15// }