feat(xo-server/api): user.removeAuthProvider

This commit is contained in:
Julien Fontanet 2023-07-31 10:44:42 +02:00 committed by Florent BEAUCHAMP
parent 2a42e0ff94
commit e51351be8d
2 changed files with 14 additions and 1 deletions

View File

@ -32,7 +32,7 @@
<!--packages-start-->
- xo-server patch
- xo-server minor
- xo-server-auth-github minor
- xo-server-auth-google minor
- xo-web patch

View File

@ -112,3 +112,16 @@ changePassword.params = {
oldPassword: { type: 'string' },
newPassword: { type: 'string' },
}
// -------------------------------------------------------------------
export async function removeAuthProvider({ id, authProvider }) {
await this.updateUser(id, { authProviders: { [authProvider]: null } })
}
removeAuthProvider.permission = 'admin'
removeAuthProvider.params = {
authProvider: { type: 'string' },
id: { type: 'string' },
}