Skip to content

Commit 6728cf4

Browse files
committed
FIX: return error message from server for null user from oauth callback
1 parent 9336d3e commit 6728cf4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server/handlers/oauth_callback.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,13 @@ func OAuthCallbackHandler() gin.HandlerFunc {
101101
ctx.JSON(400, gin.H{"error": err.Error()})
102102
return
103103
}
104-
104+
if user == nil{
105+
ctx.JSON(
106+
500,
107+
gin.H{"error": "Something Went Wrong. Please Try Again."},
108+
)
109+
return
110+
}
105111
existingUser, err := db.Provider.GetUserByEmail(ctx, refs.StringValue(user.Email))
106112
log := log.WithField("user", user.Email)
107113
isSignUp := false

0 commit comments

Comments
 (0)