fix qr auth
This commit is contained in:
@@ -238,7 +238,7 @@ export interface QrLoginSession {
|
||||
qrPayload?: string;
|
||||
claimed?: boolean;
|
||||
claimedDeviceName?: string;
|
||||
auth?: AuthTokens & { user?: PublicUser };
|
||||
auth?: Omit<AuthTokens, 'user'> & { user?: PublicUser };
|
||||
}
|
||||
|
||||
export async function createQrLoginSession(deviceName?: string) {
|
||||
@@ -257,6 +257,11 @@ export async function pollQrLoginSession(sessionId: string) {
|
||||
return apiFetch<QrLoginSession>(`/auth/advanced/qr/session/${sessionId}`);
|
||||
}
|
||||
|
||||
export async function fetchCurrentUser(token: string) {
|
||||
const session = await apiFetch<AuthSessionResponse>('/auth/session', {}, token, true, { critical: true });
|
||||
return session.user;
|
||||
}
|
||||
|
||||
export async function createDeviceLinkQrSession(userId: string, token: string) {
|
||||
return apiFetch<QrLoginSession>(`/security/users/${userId}/device-link/session`, { method: 'POST' }, token);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user