mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
fix: support VK ID OAuth 2.1 device_id in frontend
- Extract device_id from VK callback URL query params - Pass device_id through store → API → backend - Add useRef guard to prevent useEffect double-fire - Fix URL validation catch-block anti-pattern in Login - Improve error extraction in OAuthCallback (show Error.message)
This commit is contained in:
@@ -38,7 +38,12 @@ interface AuthState {
|
||||
loginWithTelegram: (initData: string) => Promise<void>;
|
||||
loginWithTelegramWidget: (data: TelegramWidgetData) => Promise<void>;
|
||||
loginWithEmail: (email: string, password: string) => Promise<void>;
|
||||
loginWithOAuth: (provider: string, code: string, state: string) => Promise<void>;
|
||||
loginWithOAuth: (
|
||||
provider: string,
|
||||
code: string,
|
||||
state: string,
|
||||
deviceId?: string | null,
|
||||
) => Promise<void>;
|
||||
registerWithEmail: (
|
||||
email: string,
|
||||
password: string,
|
||||
@@ -295,13 +300,14 @@ export const useAuthStore = create<AuthState>()(
|
||||
await get().checkAdminStatus();
|
||||
},
|
||||
|
||||
loginWithOAuth: async (provider, code, state) => {
|
||||
loginWithOAuth: async (provider, code, state, deviceId) => {
|
||||
const campaignSlug = consumeCampaignSlug();
|
||||
const referralCode = consumeReferralCode();
|
||||
const response = await authApi.oauthCallback(
|
||||
provider,
|
||||
code,
|
||||
state,
|
||||
deviceId,
|
||||
campaignSlug,
|
||||
referralCode,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user