fix: deep link auth timer cleanup and reliability

- Clear previous interval/timeout before starting new deep link auth
- Store expire timeout in ref for cleanup on unmount
- Use server expires_in instead of hardcoded 5 minutes
- Show error message when token expires (not just clear state)
- Add consumeCampaignSlug/consumeReferralCode to loginWithDeepLink
This commit is contained in:
Fringg
2026-03-17 21:46:12 +03:00
parent 6a1a9f5db7
commit 3d950252b7
2 changed files with 35 additions and 7 deletions

View File

@@ -320,6 +320,8 @@ export const useAuthStore = create<AuthState>()(
},
loginWithDeepLink: async (token) => {
consumeCampaignSlug();
consumeReferralCode();
const response = await authApi.pollDeepLinkToken(token);
tokenStorage.setTokens(response.access_token, response.refresh_token);
set({