feat: update user access (#151)

* feat: update user access

* revoked timestamp field updated

* updates

* updates

* updates
This commit is contained in:
Anik Ghosh
2022-03-24 14:13:55 +05:30
committed by GitHub
parent 1f3dec6ea6
commit b2541c8e9a
13 changed files with 477 additions and 7 deletions

View File

@@ -95,9 +95,12 @@ func OAuthCallbackHandler() gin.HandlerFunc {
user.EmailVerifiedAt = &now
user, _ = db.Provider.AddUser(user)
} else {
if user.RevokedTimestamp != nil {
c.JSON(400, gin.H{"error": "user access has been revoked"})
}
// user exists in db, check if method was google
// if not append google to existing signup method and save it
signupMethod := existingUser.SignupMethods
if !strings.Contains(signupMethod, provider) {
signupMethod = signupMethod + "," + provider