feat: fix auth

This commit is contained in:
MingLiang Wang
2023-01-09 21:56:24 +08:00
parent 8b95f13076
commit f4eb4740d8
2 changed files with 5 additions and 5 deletions

View File

@@ -124,11 +124,10 @@ export class DataCenter {
* login to all providers, it will default run all auth , * login to all providers, it will default run all auth ,
* maybe need a params to control which provider to auth * maybe need a params to control which provider to auth
*/ */
public async login() { public async login(providerId = 'affine') {
this.providers.forEach(p => { const provider = this.providerMap.get(providerId);
// TODO: may be add params of auth assert(provider, `provide '${providerId}' is not registered`);
p.auth(); provider.auth();
});
} }
/** /**

View File

@@ -189,6 +189,7 @@ export const getAuthorizer = () => {
return [signInWithGoogle, onAuthStateChanged] as const; return [signInWithGoogle, onAuthStateChanged] as const;
} catch (e) { } catch (e) {
getLogger('getAuthorizer')(e);
return [] as const; return [] as const;
} }
}; };