fix: initiate OAuth using Custom Tabs on Android, closes #361 (#788)

This commit is contained in:
Huang Xin
2025-04-01 23:04:17 +08:00
committed by GitHub
parent 7ccf3d0632
commit 6131180a31
18 changed files with 161 additions and 46 deletions
@@ -0,0 +1,25 @@
import { invoke } from '@tauri-apps/api/core';
export interface AuthRequest {
authUrl: string;
}
export interface AuthResponse {
redirectUrl: string;
}
export async function authWithSafari(request: AuthRequest): Promise<AuthResponse> {
const result = await invoke<AuthResponse>('plugin:native-bridge|auth_with_safari', {
payload: request,
});
return result;
}
export async function authWithCustomTab(request: AuthRequest): Promise<AuthResponse> {
const result = await invoke<AuthResponse>('plugin:native-bridge|auth_with_custom_tab', {
payload: request,
});
return result;
}