mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-10 01:56:49 +08:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
920ed87f75 | |||
6598f0ccdf | |||
8e71e23d75 | |||
146a369f80 | |||
9bbe5afb7c | |||
b42391c6ce |
@ -66,7 +66,11 @@ func GetConfigBool(key string) bool {
|
|||||||
func GetConfigInt64(key string) (int64, error) {
|
func GetConfigInt64(key string) (int64, error) {
|
||||||
value := GetConfigString(key)
|
value := GetConfigString(key)
|
||||||
num, err := strconv.ParseInt(value, 10, 64)
|
num, err := strconv.ParseInt(value, 10, 64)
|
||||||
return num, err
|
if err != nil {
|
||||||
|
return 0, fmt.Errorf("GetConfigInt64(%s) error, %s", key, err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
return num, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetConfigDataSourceName() string {
|
func GetConfigDataSourceName() string {
|
||||||
|
@ -42,6 +42,7 @@ type Response struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Data interface{} `json:"data"`
|
Data interface{} `json:"data"`
|
||||||
Data2 interface{} `json:"data2"`
|
Data2 interface{} `json:"data2"`
|
||||||
|
Data3 interface{} `json:"data3"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Captcha struct {
|
type Captcha struct {
|
||||||
|
@ -132,7 +132,7 @@ func (c *ApiController) HandleLoggedIn(application *object.Application, user *ob
|
|||||||
if form.Type == ResponseTypeLogin {
|
if form.Type == ResponseTypeLogin {
|
||||||
c.SetSessionUsername(userId)
|
c.SetSessionUsername(userId)
|
||||||
util.LogInfo(c.Ctx, "API: [%s] signed in", userId)
|
util.LogInfo(c.Ctx, "API: [%s] signed in", userId)
|
||||||
resp = &Response{Status: "ok", Msg: "", Data: userId, Data2: user.NeedUpdatePassword}
|
resp = &Response{Status: "ok", Msg: "", Data: userId, Data3: user.NeedUpdatePassword}
|
||||||
} else if form.Type == ResponseTypeCode {
|
} else if form.Type == ResponseTypeCode {
|
||||||
clientId := c.Input().Get("clientId")
|
clientId := c.Input().Get("clientId")
|
||||||
responseType := c.Input().Get("responseType")
|
responseType := c.Input().Get("responseType")
|
||||||
@ -154,7 +154,7 @@ func (c *ApiController) HandleLoggedIn(application *object.Application, user *ob
|
|||||||
}
|
}
|
||||||
|
|
||||||
resp = codeToResponse(code)
|
resp = codeToResponse(code)
|
||||||
resp.Data2 = user.NeedUpdatePassword
|
resp.Data3 = user.NeedUpdatePassword
|
||||||
if application.EnableSigninSession || application.HasPromptPage() {
|
if application.EnableSigninSession || application.HasPromptPage() {
|
||||||
// The prompt page needs the user to be signed in
|
// The prompt page needs the user to be signed in
|
||||||
c.SetSessionUsername(userId)
|
c.SetSessionUsername(userId)
|
||||||
@ -168,7 +168,7 @@ func (c *ApiController) HandleLoggedIn(application *object.Application, user *ob
|
|||||||
token, _ := object.GetTokenByUser(application, user, scope, nonce, c.Ctx.Request.Host)
|
token, _ := object.GetTokenByUser(application, user, scope, nonce, c.Ctx.Request.Host)
|
||||||
resp = tokenToResponse(token)
|
resp = tokenToResponse(token)
|
||||||
|
|
||||||
resp.Data2 = user.NeedUpdatePassword
|
resp.Data3 = user.NeedUpdatePassword
|
||||||
}
|
}
|
||||||
} else if form.Type == ResponseTypeDevice {
|
} else if form.Type == ResponseTypeDevice {
|
||||||
authCache, ok := object.DeviceAuthMap.LoadAndDelete(form.UserCode)
|
authCache, ok := object.DeviceAuthMap.LoadAndDelete(form.UserCode)
|
||||||
@ -195,14 +195,14 @@ func (c *ApiController) HandleLoggedIn(application *object.Application, user *ob
|
|||||||
|
|
||||||
object.DeviceAuthMap.Store(authCacheCast.UserName, deviceAuthCacheDeviceCodeCast)
|
object.DeviceAuthMap.Store(authCacheCast.UserName, deviceAuthCacheDeviceCodeCast)
|
||||||
|
|
||||||
resp = &Response{Status: "ok", Msg: "", Data: userId, Data2: user.NeedUpdatePassword}
|
resp = &Response{Status: "ok", Msg: "", Data: userId, Data3: user.NeedUpdatePassword}
|
||||||
} else if form.Type == ResponseTypeSaml { // saml flow
|
} else if form.Type == ResponseTypeSaml { // saml flow
|
||||||
res, redirectUrl, method, err := object.GetSamlResponse(application, user, form.SamlRequest, c.Ctx.Request.Host)
|
res, redirectUrl, method, err := object.GetSamlResponse(application, user, form.SamlRequest, c.Ctx.Request.Host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.ResponseError(err.Error(), nil)
|
c.ResponseError(err.Error(), nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp = &Response{Status: "ok", Msg: "", Data: res, Data2: map[string]interface{}{"redirectUrl": redirectUrl, "method": method, "needUpdatePassword": user.NeedUpdatePassword}}
|
resp = &Response{Status: "ok", Msg: "", Data: res, Data2: map[string]interface{}{"redirectUrl": redirectUrl, "method": method}, Data3: user.NeedUpdatePassword}
|
||||||
|
|
||||||
if application.EnableSigninSession || application.HasPromptPage() {
|
if application.EnableSigninSession || application.HasPromptPage() {
|
||||||
// The prompt page needs the user to be signed in
|
// The prompt page needs the user to be signed in
|
||||||
|
@ -16,6 +16,7 @@ package controllers
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/beego/beego/utils/pagination"
|
"github.com/beego/beego/utils/pagination"
|
||||||
@ -460,7 +461,18 @@ func (c *ApiController) IntrospectToken() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if token != nil {
|
if token != nil {
|
||||||
|
application, err = object.GetApplication(fmt.Sprintf("%s/%s", token.Owner, token.Application))
|
||||||
|
if err != nil {
|
||||||
|
c.ResponseTokenError(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if application == nil {
|
||||||
|
c.ResponseError(fmt.Sprintf(c.T("auth:The application: %s does not exist"), token.Application))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
introspectionResponse.TokenType = token.TokenType
|
introspectionResponse.TokenType = token.TokenType
|
||||||
|
introspectionResponse.ClientId = application.ClientId
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Data["json"] = introspectionResponse
|
c.Data["json"] = introspectionResponse
|
||||||
|
@ -31,7 +31,7 @@ func (cm *Argon2idCredManager) GetHashedPassword(password string, salt string) s
|
|||||||
return hash
|
return hash
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cm *Argon2idCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, userSalt string, organizationSalt string) bool {
|
func (cm *Argon2idCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, salt string) bool {
|
||||||
match, _ := argon2id.ComparePasswordAndHash(plainPwd, hashedPwd)
|
match, _ := argon2id.ComparePasswordAndHash(plainPwd, hashedPwd)
|
||||||
return match
|
return match
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ func (cm *BcryptCredManager) GetHashedPassword(password string, salt string) str
|
|||||||
return string(bytes)
|
return string(bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cm *BcryptCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, userSalt string, organizationSalt string) bool {
|
func (cm *BcryptCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, salt string) bool {
|
||||||
err := bcrypt.CompareHashAndPassword([]byte(hashedPwd), []byte(plainPwd))
|
err := bcrypt.CompareHashAndPassword([]byte(hashedPwd), []byte(plainPwd))
|
||||||
return err == nil
|
return err == nil
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ package cred
|
|||||||
|
|
||||||
type CredManager interface {
|
type CredManager interface {
|
||||||
GetHashedPassword(password string, salt string) string
|
GetHashedPassword(password string, salt string) string
|
||||||
IsPasswordCorrect(password string, passwordHash string, userSalt string, organizationSalt string) bool
|
IsPasswordCorrect(password string, passwordHash string, salt string) bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetCredManager(passwordType string) CredManager {
|
func GetCredManager(passwordType string) CredManager {
|
||||||
|
@ -41,9 +41,6 @@ func (cm *Md5UserSaltCredManager) GetHashedPassword(password string, salt string
|
|||||||
return getMd5HexDigest(getMd5HexDigest(password) + salt)
|
return getMd5HexDigest(getMd5HexDigest(password) + salt)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cm *Md5UserSaltCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, userSalt string, organizationSalt string) bool {
|
func (cm *Md5UserSaltCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, salt string) bool {
|
||||||
if hashedPwd == cm.GetHashedPassword(plainPwd, organizationSalt) {
|
return hashedPwd == cm.GetHashedPassword(plainPwd, salt)
|
||||||
return true
|
|
||||||
}
|
|
||||||
return hashedPwd == cm.GetHashedPassword(plainPwd, userSalt)
|
|
||||||
}
|
}
|
||||||
|
@ -35,9 +35,6 @@ func (cm *Pbkdf2SaltCredManager) GetHashedPassword(password string, salt string)
|
|||||||
return base64.StdEncoding.EncodeToString(res)
|
return base64.StdEncoding.EncodeToString(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cm *Pbkdf2SaltCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, userSalt string, organizationSalt string) bool {
|
func (cm *Pbkdf2SaltCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, salt string) bool {
|
||||||
if hashedPwd == cm.GetHashedPassword(plainPwd, organizationSalt) {
|
return hashedPwd == cm.GetHashedPassword(plainPwd, salt)
|
||||||
return true
|
|
||||||
}
|
|
||||||
return hashedPwd == cm.GetHashedPassword(plainPwd, userSalt)
|
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ func (m *Pbkdf2DjangoCredManager) GetHashedPassword(password string, salt string
|
|||||||
return "pbkdf2_sha256$" + strconv.Itoa(iterations) + "$" + salt + "$" + hashBase64
|
return "pbkdf2_sha256$" + strconv.Itoa(iterations) + "$" + salt + "$" + hashBase64
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Pbkdf2DjangoCredManager) IsPasswordCorrect(password string, passwordHash string, userSalt string, organizationSalt string) bool {
|
func (m *Pbkdf2DjangoCredManager) IsPasswordCorrect(password string, passwordHash string, _salt string) bool {
|
||||||
parts := strings.Split(passwordHash, "$")
|
parts := strings.Split(passwordHash, "$")
|
||||||
if len(parts) != 4 {
|
if len(parts) != 4 {
|
||||||
return false
|
return false
|
||||||
|
@ -25,6 +25,6 @@ func (cm *PlainCredManager) GetHashedPassword(password string, salt string) stri
|
|||||||
return password
|
return password
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cm *PlainCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, userSalt string, organizationSalt string) bool {
|
func (cm *PlainCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, salt string) bool {
|
||||||
return hashedPwd == plainPwd
|
return hashedPwd == plainPwd
|
||||||
}
|
}
|
||||||
|
@ -41,9 +41,6 @@ func (cm *Sha256SaltCredManager) GetHashedPassword(password string, salt string)
|
|||||||
return getSha256HexDigest(getSha256HexDigest(password) + salt)
|
return getSha256HexDigest(getSha256HexDigest(password) + salt)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cm *Sha256SaltCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, userSalt string, organizationSalt string) bool {
|
func (cm *Sha256SaltCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, salt string) bool {
|
||||||
if hashedPwd == cm.GetHashedPassword(plainPwd, organizationSalt) {
|
return hashedPwd == cm.GetHashedPassword(plainPwd, salt)
|
||||||
return true
|
|
||||||
}
|
|
||||||
return hashedPwd == cm.GetHashedPassword(plainPwd, userSalt)
|
|
||||||
}
|
}
|
||||||
|
@ -41,9 +41,6 @@ func (cm *Sha512SaltCredManager) GetHashedPassword(password string, salt string)
|
|||||||
return getSha512HexDigest(getSha512HexDigest(password) + salt)
|
return getSha512HexDigest(getSha512HexDigest(password) + salt)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cm *Sha512SaltCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, userSalt string, organizationSalt string) bool {
|
func (cm *Sha512SaltCredManager) IsPasswordCorrect(plainPwd string, hashedPwd string, salt string) bool {
|
||||||
if hashedPwd == cm.GetHashedPassword(plainPwd, organizationSalt) {
|
return hashedPwd == cm.GetHashedPassword(plainPwd, salt)
|
||||||
return true
|
|
||||||
}
|
|
||||||
return hashedPwd == cm.GetHashedPassword(plainPwd, userSalt)
|
|
||||||
}
|
}
|
||||||
|
@ -220,10 +220,15 @@ func checkSigninErrorTimes(user *User, lang string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func CheckPassword(user *User, password string, lang string, options ...bool) error {
|
func CheckPassword(user *User, password string, lang string, options ...bool) error {
|
||||||
|
if password == "" {
|
||||||
|
return fmt.Errorf(i18n.Translate(lang, "check:Password cannot be empty"))
|
||||||
|
}
|
||||||
|
|
||||||
enableCaptcha := false
|
enableCaptcha := false
|
||||||
if len(options) > 0 {
|
if len(options) > 0 {
|
||||||
enableCaptcha = options[0]
|
enableCaptcha = options[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
// check the login error times
|
// check the login error times
|
||||||
if !enableCaptcha {
|
if !enableCaptcha {
|
||||||
err := checkSigninErrorTimes(user, lang)
|
err := checkSigninErrorTimes(user, lang)
|
||||||
@ -236,35 +241,31 @@ func CheckPassword(user *User, password string, lang string, options ...bool) er
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if organization == nil {
|
if organization == nil {
|
||||||
return fmt.Errorf(i18n.Translate(lang, "check:Organization does not exist"))
|
return fmt.Errorf(i18n.Translate(lang, "check:Organization does not exist"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if password == "" {
|
|
||||||
return fmt.Errorf(i18n.Translate(lang, "check:Password cannot be empty"))
|
|
||||||
}
|
|
||||||
|
|
||||||
passwordType := user.PasswordType
|
passwordType := user.PasswordType
|
||||||
if passwordType == "" {
|
if passwordType == "" {
|
||||||
passwordType = organization.PasswordType
|
passwordType = organization.PasswordType
|
||||||
}
|
}
|
||||||
|
|
||||||
credManager := cred.GetCredManager(passwordType)
|
credManager := cred.GetCredManager(passwordType)
|
||||||
if credManager != nil {
|
if credManager == nil {
|
||||||
if organization.MasterPassword != "" {
|
|
||||||
if password == organization.MasterPassword || credManager.IsPasswordCorrect(password, organization.MasterPassword, "", organization.PasswordSalt) {
|
|
||||||
return resetUserSigninErrorTimes(user)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if credManager.IsPasswordCorrect(password, user.Password, user.PasswordSalt, organization.PasswordSalt) {
|
|
||||||
return resetUserSigninErrorTimes(user)
|
|
||||||
}
|
|
||||||
|
|
||||||
return recordSigninErrorInfo(user, lang, enableCaptcha)
|
|
||||||
} else {
|
|
||||||
return fmt.Errorf(i18n.Translate(lang, "check:unsupported password type: %s"), organization.PasswordType)
|
return fmt.Errorf(i18n.Translate(lang, "check:unsupported password type: %s"), organization.PasswordType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if organization.MasterPassword != "" {
|
||||||
|
if password == organization.MasterPassword || credManager.IsPasswordCorrect(password, organization.MasterPassword, organization.PasswordSalt) {
|
||||||
|
return resetUserSigninErrorTimes(user)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !credManager.IsPasswordCorrect(password, user.Password, organization.PasswordSalt) && !credManager.IsPasswordCorrect(password, user.Password, user.PasswordSalt) {
|
||||||
|
return recordSigninErrorInfo(user, lang, enableCaptcha)
|
||||||
|
}
|
||||||
|
|
||||||
|
return resetUserSigninErrorTimes(user)
|
||||||
}
|
}
|
||||||
|
|
||||||
func CheckPasswordComplexityByOrg(organization *Organization, password string) string {
|
func CheckPasswordComplexityByOrg(organization *Organization, password string) string {
|
||||||
|
@ -66,6 +66,10 @@ func AutoSigninFilter(ctx *context.Context) {
|
|||||||
responseError(ctx, err.Error())
|
responseError(ctx, err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if application == nil {
|
||||||
|
responseError(ctx, fmt.Sprintf("No application is found for userId: app/%s", token.Application))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
setSessionUser(ctx, userId)
|
setSessionUser(ctx, userId)
|
||||||
setSessionOidc(ctx, token.Scope, application.ClientId)
|
setSessionOidc(ctx, token.Scope, application.ClientId)
|
||||||
|
@ -166,7 +166,7 @@ class AuthCallback extends React.Component {
|
|||||||
const responseType = this.getResponseType();
|
const responseType = this.getResponseType();
|
||||||
const handleLogin = (res) => {
|
const handleLogin = (res) => {
|
||||||
if (responseType === "login") {
|
if (responseType === "login") {
|
||||||
if (res.data2) {
|
if (res.data3) {
|
||||||
sessionStorage.setItem("signinUrl", signinUrl);
|
sessionStorage.setItem("signinUrl", signinUrl);
|
||||||
Setting.goToLinkSoft(this, `/forget/${applicationName}`);
|
Setting.goToLinkSoft(this, `/forget/${applicationName}`);
|
||||||
return;
|
return;
|
||||||
@ -176,7 +176,7 @@ class AuthCallback extends React.Component {
|
|||||||
const link = Setting.getFromLink();
|
const link = Setting.getFromLink();
|
||||||
Setting.goToLink(link);
|
Setting.goToLink(link);
|
||||||
} else if (responseType === "code") {
|
} else if (responseType === "code") {
|
||||||
if (res.data2) {
|
if (res.data3) {
|
||||||
sessionStorage.setItem("signinUrl", signinUrl);
|
sessionStorage.setItem("signinUrl", signinUrl);
|
||||||
Setting.goToLinkSoft(this, `/forget/${applicationName}`);
|
Setting.goToLinkSoft(this, `/forget/${applicationName}`);
|
||||||
return;
|
return;
|
||||||
@ -185,7 +185,7 @@ class AuthCallback extends React.Component {
|
|||||||
Setting.goToLink(`${oAuthParams.redirectUri}${concatChar}code=${code}&state=${oAuthParams.state}`);
|
Setting.goToLink(`${oAuthParams.redirectUri}${concatChar}code=${code}&state=${oAuthParams.state}`);
|
||||||
// Setting.showMessage("success", `Authorization code: ${res.data}`);
|
// Setting.showMessage("success", `Authorization code: ${res.data}`);
|
||||||
} else if (responseType === "token" || responseType === "id_token") {
|
} else if (responseType === "token" || responseType === "id_token") {
|
||||||
if (res.data2) {
|
if (res.data3) {
|
||||||
sessionStorage.setItem("signinUrl", signinUrl);
|
sessionStorage.setItem("signinUrl", signinUrl);
|
||||||
Setting.goToLinkSoft(this, `/forget/${applicationName}`);
|
Setting.goToLinkSoft(this, `/forget/${applicationName}`);
|
||||||
return;
|
return;
|
||||||
@ -207,7 +207,7 @@ class AuthCallback extends React.Component {
|
|||||||
relayState: oAuthParams.relayState,
|
relayState: oAuthParams.relayState,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (res.data2.needUpdatePassword) {
|
if (res.data3) {
|
||||||
sessionStorage.setItem("signinUrl", signinUrl);
|
sessionStorage.setItem("signinUrl", signinUrl);
|
||||||
Setting.goToLinkSoft(this, `/forget/${applicationName}`);
|
Setting.goToLinkSoft(this, `/forget/${applicationName}`);
|
||||||
return;
|
return;
|
||||||
|
@ -496,9 +496,9 @@ class LoginPage extends React.Component {
|
|||||||
const responseType = values["type"];
|
const responseType = values["type"];
|
||||||
|
|
||||||
if (responseType === "login") {
|
if (responseType === "login") {
|
||||||
if (res.data2) {
|
if (res.data3) {
|
||||||
sessionStorage.setItem("signinUrl", window.location.pathname + window.location.search);
|
sessionStorage.setItem("signinUrl", window.location.pathname + window.location.search);
|
||||||
Setting.goToLink(this, `/forget/${this.state.applicationName}`);
|
Setting.goToLinkSoft(this, `/forget/${this.state.applicationName}`);
|
||||||
}
|
}
|
||||||
Setting.showMessage("success", i18next.t("application:Logged in successfully"));
|
Setting.showMessage("success", i18next.t("application:Logged in successfully"));
|
||||||
this.props.onLoginSuccess();
|
this.props.onLoginSuccess();
|
||||||
@ -510,9 +510,9 @@ class LoginPage extends React.Component {
|
|||||||
userCodeStatus: "success",
|
userCodeStatus: "success",
|
||||||
});
|
});
|
||||||
} else if (responseType === "token" || responseType === "id_token") {
|
} else if (responseType === "token" || responseType === "id_token") {
|
||||||
if (res.data2) {
|
if (res.data3) {
|
||||||
sessionStorage.setItem("signinUrl", window.location.pathname + window.location.search);
|
sessionStorage.setItem("signinUrl", window.location.pathname + window.location.search);
|
||||||
Setting.goToLink(this, `/forget/${this.state.applicationName}`);
|
Setting.goToLinkSoft(this, `/forget/${this.state.applicationName}`);
|
||||||
}
|
}
|
||||||
const amendatoryResponseType = responseType === "token" ? "access_token" : responseType;
|
const amendatoryResponseType = responseType === "token" ? "access_token" : responseType;
|
||||||
const accessToken = res.data;
|
const accessToken = res.data;
|
||||||
@ -522,9 +522,9 @@ class LoginPage extends React.Component {
|
|||||||
this.props.onLoginSuccess(window.location.href);
|
this.props.onLoginSuccess(window.location.href);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (res.data2.needUpdatePassword) {
|
if (res.data3) {
|
||||||
sessionStorage.setItem("signinUrl", window.location.pathname + window.location.search);
|
sessionStorage.setItem("signinUrl", window.location.pathname + window.location.search);
|
||||||
Setting.goToLink(this, `/forget/${this.state.applicationName}`);
|
Setting.goToLinkSoft(this, `/forget/${this.state.applicationName}`);
|
||||||
}
|
}
|
||||||
if (res.data2.method === "POST") {
|
if (res.data2.method === "POST") {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
Reference in New Issue
Block a user