mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: add support for unlink oauth account
This commit is contained in:
2 files changed
+10
-3
No files matched your search
@@ -259,6 +259,13 @@ class HomeSecurityHandler extends Handler {
|
||||
await this.ctx.oauth.providers[platform].get.call(this);
|
||||
}
|
||||
|
||||
@param('platform', Types.String)
|
||||
async postUnlinkAccount({ }, platform: string) {
|
||||
if (!this.ctx.oauth.providers[platform]) throw new ValidationError('platform');
|
||||
await this.ctx.oauth.unbind(platform, this.user._id);
|
||||
this.back();
|
||||
}
|
||||
|
||||
@param('tokenDigest', Types.String)
|
||||
async postDeleteToken({ }, tokenDigest: string) {
|
||||
const sessions = await token.getSessionListByUid(this.user._id);
|
||||
|
||||
Reference in new issue
Block a user