clipped
Some checks failed
Deploy / deploy (push) Has been skipped
CI / lint (push) Failing after 7m29s
CI / test (push) Failing after 12m41s

This commit is contained in:
2025-09-01 23:08:38 +03:00
parent 112f102bb5
commit eaa99108a9

View File

@@ -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
}
});