@@ -96,8 +96,7 @@ impl FromRequestParts<GatewayState> for AuthUser {
9696 }
9797
9898 // Fall back to session auth (OIDC JWT, NextAuth cookie, or local mode)
99- let user_id =
100- validate_request ( pool, & parts. headers , state. jwks . as_ref ( ) ) . await ?;
99+ let user_id = validate_request ( pool, & parts. headers , state. jwks . as_ref ( ) ) . await ?;
101100
102101 // Resolve account from membership
103102 let account_id = db:: find_account_id_by_user ( pool, & user_id)
@@ -199,10 +198,7 @@ async fn validate_oauth(
199198async fn try_bearer_jwt ( headers : & HeaderMap , jwks : Option < & JwksManager > ) -> Option < String > {
200199 let jwks = jwks?;
201200
202- let auth_header = headers
203- . get ( hyper:: header:: AUTHORIZATION ) ?
204- . to_str ( )
205- . ok ( ) ?;
201+ let auth_header = headers. get ( hyper:: header:: AUTHORIZATION ) ?. to_str ( ) . ok ( ) ?;
206202
207203 let token = auth_header
208204 . strip_prefix ( "Bearer " )
@@ -223,10 +219,7 @@ async fn try_bearer_jwt(headers: &HeaderMap, jwks: Option<&JwksManager>) -> Opti
223219}
224220
225221/// Validate a NextAuth session cookie (HS256 JWT signed with NEXTAUTH_SECRET).
226- async fn validate_nextauth_cookie (
227- pool : & PgPool ,
228- headers : & HeaderMap ,
229- ) -> Result < String , AuthError > {
222+ async fn validate_nextauth_cookie ( pool : & PgPool , headers : & HeaderMap ) -> Result < String , AuthError > {
230223 let cookie_header = headers
231224 . get ( hyper:: header:: COOKIE )
232225 . and_then ( |v| v. to_str ( ) . ok ( ) )
0 commit comments