mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix: failed to load blobs in electron (#1927)
This commit is contained in:
@@ -67,10 +67,13 @@ export const setLoginStorage = (login: LoginResponse) => {
|
||||
};
|
||||
|
||||
const signInWithElectron = async (firebaseAuth: FirebaseAuth) => {
|
||||
const code = await window.apis?.googleSignIn();
|
||||
const credential = GoogleAuthProvider.credential(code);
|
||||
const user = await signInWithCredential(firebaseAuth, credential);
|
||||
return await user.user.getIdToken();
|
||||
if (window.apis) {
|
||||
const { url, requestInit } = await window.apis.getGoogleOauthCode();
|
||||
const { id_token } = await fetch(url, requestInit).then(res => res.json());
|
||||
const credential = GoogleAuthProvider.credential(id_token);
|
||||
const user = await signInWithCredential(firebaseAuth, credential);
|
||||
return await user.user.getIdToken();
|
||||
}
|
||||
};
|
||||
|
||||
export const clearLoginStorage = () => {
|
||||
|
||||
Reference in New Issue
Block a user