Skip to content

Commit

Permalink
feat: prompt open vscode after user granted
Browse files Browse the repository at this point in the history
  • Loading branch information
laggage committed Jan 5, 2022
1 parent deccd6e commit cb770a5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/services/cnblogs-oauth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ export class CnblogsOAuthService extends Disposable {
throw Error(`Unable to resolve authorization code from callback url, ${req.originalUrl}`);
}
authorizationInfo = await this.getAuthorizationInfo(code, this._codeVerifier);
res.send('授权成功, 您现在可以关闭此页面, 返回vscode.');
res.send(
`<p>授权成功, 您现在可以关闭此页面, 返回vscode.</p>
<script type="text/javascript">
var el = document.createElement('a');
el.href='vscode://vscode.vscode-cnb';
el.click();
</script>`
);
} catch (err) {
error = err;
const stringifiedError = JSON.stringify(err, undefined, 4);
Expand Down

0 comments on commit cb770a5

Please sign in to comment.