Skip to content

Commit

Permalink
fix: get recovery mode before notify sign in event
Browse files Browse the repository at this point in the history
  • Loading branch information
leynier committed Dec 2, 2021
1 parent 19f4556 commit 4ef96ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gotrue/_async/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,9 @@ async def get_session_from_url(
)
if store_session:
await self._save_session(session=session)
recovery_mode = query.get("type")
self._notify_all_subscribers(event=AuthChangeEvent.SIGNED_IN)
if query.get("type") == "recovery":
if recovery_mode == "recovery":
self._notify_all_subscribers(event=AuthChangeEvent.PASSWORD_RECOVERY)
return session

Expand Down
3 changes: 2 additions & 1 deletion gotrue/_sync/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,9 @@ def get_session_from_url(self, *, url: str, store_session: bool = False) -> Sess
)
if store_session:
self._save_session(session=session)
recovery_mode = query.get("type")
self._notify_all_subscribers(event=AuthChangeEvent.SIGNED_IN)
if query.get("type") == "recovery":
if recovery_mode == "recovery":
self._notify_all_subscribers(event=AuthChangeEvent.PASSWORD_RECOVERY)
return session

Expand Down

0 comments on commit 4ef96ce

Please sign in to comment.