Decode the Supabase JWT to get the available data about the authenticated user.
(token: str)
| 126 | |
| 127 | |
| 128 | def _decode_supabase_jwt(token: str) -> SupabaseUserData: |
| 129 | """ |
| 130 | Decode the Supabase JWT to get the available data about the authenticated user. |
| 131 | """ |
| 132 | # Add leeway to account for clock skew between Supabase and our server |
| 133 | user_info = jwt.decode( |
| 134 | token, SUPABASE_JWT_SECRET, algorithms=['HS256'], audience="authenticated", leeway=10 |
| 135 | ) |
| 136 | return SupabaseUserData(**user_info) |
| 137 | |
| 138 | |
| 139 | def _encode_session_cookie(session: Session) -> str: |
no test coverage detected
searching dependent graphs…