Skip to content

Commit

Permalink
refresh_access_token in supabase
Browse files Browse the repository at this point in the history
  • Loading branch information
dejima-shikou committed Feb 28, 2025
1 parent 6f52a41 commit 6dad5d0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions api/app/auth/supabase_auth_module.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os

from supabase import create_client

from app.auth.auth_module import AuthModule
from supabase import create_client

from ..schemas import Token

Expand Down Expand Up @@ -34,7 +33,13 @@ def login_for_access_token(self, username, password) -> Token:
)

def refresh_access_token(self, refresh_token) -> Token:
return Token(access_token="", token_type="bearer", refresh_token="")
session_data = self.supabase.auth.get_session()
session = session_data.model_dump()
return Token(
access_token=session.get("access_token"),
token_type="bearer",
refresh_token=session.get("refresh_token"),
)

def check_and_get_user_info(self, token):
super().check_token(token)
Expand Down

0 comments on commit 6dad5d0

Please sign in to comment.