core: add support for unlink oauth account

This commit is contained in:
undefined committed 2025-08-28 01:06:43 +08:00
1 parent f18efc6bbb
commit 0ddcee7336
2 files changed
+10 -3

No files matched your search

+7
View File
@@ -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);