mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 23:07:02 +08:00
Merge branch 'feat/poc' into feat/datacenter
This commit is contained in:
@@ -124,20 +124,19 @@ 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();
|
await provider.auth();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* logout from all providers
|
* logout from all providers
|
||||||
*/
|
*/
|
||||||
public async logout() {
|
public async logout(providerId = 'affine') {
|
||||||
this.providers.forEach(p => {
|
const provider = this.providerMap.get(providerId);
|
||||||
p.logout();
|
assert(provider, `provide '${providerId}' is not registered`);
|
||||||
});
|
await provider.logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user