[fix] tauri redirect fix

This commit is contained in:
kwaroran
2023-05-10 08:19:39 +09:00
parent ca72c7c7c7
commit c8d3b26fe9

View File

@@ -10,7 +10,7 @@ import { open } from '@tauri-apps/api/shell';
export async function checkDriver(type:'save'|'load'|'loadtauri'|'savetauri'){
const CLIENT_ID = '580075990041-l26k2d3c0nemmqiu3d3aag01npfrkn76.apps.googleusercontent.com';
const REDIRECT_URI = `https://${location.host}/`
const REDIRECT_URI = isTauri ? "https://risuai.xyz/" : `https://${location.host}/`
const SCOPE = 'https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.appdata';
const encodedRedirectUri = encodeURIComponent(REDIRECT_URI);
const authorizationUrl = `https://accounts.google.com/o/oauth2/auth?client_id=${CLIENT_ID}&redirect_uri=${encodedRedirectUri}&scope=${SCOPE}&response_type=code&state=${type}`;