fix: magic link login

This commit is contained in:
Lakhan Samani 2022-03-08 22:41:33 +05:30
parent 60cd317e67
commit 5d73df0040
4 changed files with 11 additions and 11 deletions

14
app/package-lock.json generated
View File

@ -9,7 +9,7 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"@authorizerdev/authorizer-react": "0.9.0-beta.2",
"@authorizerdev/authorizer-react": "0.9.0-beta.3",
"@types/react": "^17.0.15",
"@types/react-dom": "^17.0.9",
"esbuild": "^0.12.17",
@ -35,9 +35,9 @@
}
},
"node_modules/@authorizerdev/authorizer-react": {
"version": "0.9.0-beta.2",
"resolved": "https://registry.npmjs.org/@authorizerdev/authorizer-react/-/authorizer-react-0.9.0-beta.2.tgz",
"integrity": "sha512-clngw7MdFzvnns9rgrg9fHRH4p3K+HGGMju6qhdjDF+4vPruSu6HwBi1hRvVxLi1q7CZ25CEE7CfA7Vfq7H3Bw==",
"version": "0.9.0-beta.3",
"resolved": "https://registry.npmjs.org/@authorizerdev/authorizer-react/-/authorizer-react-0.9.0-beta.3.tgz",
"integrity": "sha512-P93PW6W3Qm9BW3160gn0Ce+64UCFAOpoEOHf5537LgFPE8LpNAIU3EI6EtMNkOJS58pu1h2UkfyRyX/j0Pohjw==",
"dependencies": {
"@authorizerdev/authorizer-js": "^0.4.0-beta.0",
"final-form": "^4.20.2",
@ -837,9 +837,9 @@
}
},
"@authorizerdev/authorizer-react": {
"version": "0.9.0-beta.2",
"resolved": "https://registry.npmjs.org/@authorizerdev/authorizer-react/-/authorizer-react-0.9.0-beta.2.tgz",
"integrity": "sha512-clngw7MdFzvnns9rgrg9fHRH4p3K+HGGMju6qhdjDF+4vPruSu6HwBi1hRvVxLi1q7CZ25CEE7CfA7Vfq7H3Bw==",
"version": "0.9.0-beta.3",
"resolved": "https://registry.npmjs.org/@authorizerdev/authorizer-react/-/authorizer-react-0.9.0-beta.3.tgz",
"integrity": "sha512-P93PW6W3Qm9BW3160gn0Ce+64UCFAOpoEOHf5537LgFPE8LpNAIU3EI6EtMNkOJS58pu1h2UkfyRyX/j0Pohjw==",
"requires": {
"@authorizerdev/authorizer-js": "^0.4.0-beta.0",
"final-form": "^4.20.2",

View File

@ -11,7 +11,7 @@
"author": "Lakhan Samani",
"license": "ISC",
"dependencies": {
"@authorizerdev/authorizer-react": "0.9.0-beta.2",
"@authorizerdev/authorizer-react": "0.9.0-beta.3",
"@types/react": "^17.0.15",
"@types/react-dom": "^17.0.9",
"esbuild": "^0.12.17",

View File

@ -13,7 +13,7 @@ import (
// Handler to logout user
func LogoutHandler() gin.HandlerFunc {
return func(gc *gin.Context) {
redirectURL := strings.TrimSpace(gc.Query("redirect_url"))
redirectURL := strings.TrimSpace(gc.Query("redirect_uri"))
// get fingerprint hash
fingerprintHash, err := cookie.GetSession(gc)
if err != nil {
@ -37,7 +37,7 @@ func LogoutHandler() gin.HandlerFunc {
cookie.DeleteSession(gc)
if redirectURL != "" {
gc.Redirect(http.StatusPermanentRedirect, redirectURL)
gc.Redirect(http.StatusFound, redirectURL)
} else {
gc.JSON(http.StatusOK, gin.H{
"message": "Logged out successfully",

View File

@ -18,7 +18,7 @@ func CreateVerificationToken(email, tokenType, hostname, nonceHash, redirectURL
"iat": time.Now().Unix(),
"token_type": tokenType,
"nonce": nonceHash,
"redirect_url": redirectURL,
"redirect_uri": redirectURL,
}
return SignJWTToken(claims)