mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-17 13:54:11 +00:00
UBERF-8251: Fix github re-authenticate (#6704)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
4ae95a447f
commit
33e132cb00
@ -24,10 +24,10 @@ export async function onAuthorize (login?: string): Promise<void> {
|
|||||||
)
|
)
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
const config = await client.findOne(github.class.GithubAuthentication, {})
|
// Remove old authorizations.
|
||||||
|
const config = await client.findAll(github.class.GithubAuthentication, {})
|
||||||
if (config !== undefined) {
|
for (const c of config) {
|
||||||
await client.remove(config)
|
await client.remove(c)
|
||||||
}
|
}
|
||||||
await client.createDoc<GithubAuthentication>(github.class.GithubAuthentication, core.space.Workspace, {
|
await client.createDoc<GithubAuthentication>(github.class.GithubAuthentication, core.space.Workspace, {
|
||||||
attachedTo: meId,
|
attachedTo: meId,
|
||||||
|
Loading…
Reference in New Issue
Block a user