mirror of
https://github.com/certd/certd.git
synced 2026-05-17 22:07:34 +08:00
fix: 修复clogin登录丢失state问题
This commit is contained in:
@@ -82,14 +82,22 @@ export class ConnectController extends BaseController {
|
||||
const bindUrl = installInfo?.bindUrl || "";
|
||||
//构造登录url
|
||||
const redirectUrl = `${bindUrl}api/oauth/callback/${body.type}`;
|
||||
|
||||
let stateObj = {
|
||||
forType: body.forType || 'login',
|
||||
}
|
||||
const state = utils.hash.base64(JSON.stringify(stateObj))
|
||||
const { loginUrl, ticketValue } = await oauthProvider.addon.buildLoginUrl({
|
||||
redirectUri: redirectUrl,
|
||||
forType: body.forType,
|
||||
from: body.from || "web",
|
||||
subtype: body.subtype,
|
||||
state,
|
||||
});
|
||||
|
||||
const ticket = this.codeService.setValidationValue({
|
||||
...ticketValue,
|
||||
state,
|
||||
subtype: body.subtype,
|
||||
})
|
||||
this.ctx.cookies.set("oauth_ticket", ticket, {
|
||||
|
||||
Reference in New Issue
Block a user