fix: redirect uri
This commit is contained in:
parent
c6add0cca6
commit
360dd3c3bd
|
@ -214,7 +214,7 @@ func OAuthCallbackHandler() gin.HandlerFunc {
|
|||
if strings.Contains(redirectURL, "?") {
|
||||
redirectURL = redirectURL + "&" + params
|
||||
} else {
|
||||
redirectURL = redirectURL + "?" + params
|
||||
redirectURL = redirectURL + "?" + strings.TrimPrefix(params, "&")
|
||||
}
|
||||
|
||||
c.Redirect(http.StatusTemporaryRedirect, redirectURL)
|
||||
|
|
|
@ -42,7 +42,6 @@ func VerifyEmailHandler() gin.HandlerFunc {
|
|||
|
||||
// verify if token exists in db
|
||||
hostname := parsers.GetHost(c)
|
||||
log.Debug("hostname used for jwt verification: ", hostname)
|
||||
claim, err := token.ParseJWTToken(tokenInQuery, hostname, verificationRequest.Nonce, verificationRequest.Email)
|
||||
if err != nil {
|
||||
log.Debug("Error parsing token: ", err)
|
||||
|
@ -116,7 +115,7 @@ func VerifyEmailHandler() gin.HandlerFunc {
|
|||
if strings.Contains(redirectURL, "?") {
|
||||
redirectURL = redirectURL + "&" + params
|
||||
} else {
|
||||
redirectURL = redirectURL + "?" + params
|
||||
redirectURL = redirectURL + "?" + strings.TrimPrefix(params, "&")
|
||||
}
|
||||
|
||||
go db.Provider.AddSession(models.Session{
|
||||
|
|
|
@ -197,7 +197,7 @@ func MagicLinkLoginResolver(ctx context.Context, params model.MagicLinkLoginInpu
|
|||
if strings.Contains(redirectURL, "?") {
|
||||
redirectURL = redirectURL + "&" + redirectURLParams
|
||||
} else {
|
||||
redirectURL = redirectURL + "?" + redirectURLParams
|
||||
redirectURL = redirectURL + "?" + strings.TrimPrefix(redirectURLParams, "&")
|
||||
}
|
||||
|
||||
verificationType := constants.VerificationTypeMagicLinkLogin
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"errors"
|
||||
|
||||
"github.com/golang-jwt/jwt"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/authorizerdev/authorizer/server/constants"
|
||||
"github.com/authorizerdev/authorizer/server/crypto"
|
||||
|
@ -117,7 +116,6 @@ func ParseJWTToken(token, hostname, nonce, subject string) (jwt.MapClaims, error
|
|||
intIat := int64(claims["iat"].(float64))
|
||||
claims["exp"] = intExp
|
||||
claims["iat"] = intIat
|
||||
log.Debug("claims: ", claims)
|
||||
clientID, err := memorystore.Provider.GetStringStoreEnvVariable(constants.EnvKeyClientID)
|
||||
if err != nil {
|
||||
return claims, err
|
||||
|
@ -199,7 +197,6 @@ func ParseJWTTokenWithoutNonce(token, hostname string) (jwt.MapClaims, error) {
|
|||
intIat := int64(claims["iat"].(float64))
|
||||
claims["exp"] = intExp
|
||||
claims["iat"] = intIat
|
||||
log.Debug("claims: ", claims)
|
||||
clientID, err := memorystore.Provider.GetStringStoreEnvVariable(constants.EnvKeyClientID)
|
||||
if err != nil {
|
||||
return claims, err
|
||||
|
|
Loading…
Reference in New Issue
Block a user