clipped
This commit is contained in:
@@ -29,12 +29,12 @@ pub async fn get_current_user_handler(
|
||||
.headers()
|
||||
.get("Authorization")
|
||||
.and_then(|header_value| header_value.to_str().ok())
|
||||
.and_then(|auth_str| {
|
||||
.map(|auth_str| {
|
||||
// Убираем префикс "Bearer " если он есть
|
||||
if auth_str.starts_with("Bearer ") {
|
||||
Some(&auth_str[7..])
|
||||
if let Some(stripped) = auth_str.strip_prefix("Bearer ") {
|
||||
stripped
|
||||
} else {
|
||||
Some(auth_str)
|
||||
auth_str
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user