Skip to content

Commit

Permalink
feat: add usertype to jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
Bikram-ghuku committed Nov 26, 2024
1 parent 3afe040 commit 2e1ed95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ func OAuth(w http.ResponseWriter, r *http.Request) {
if isOrganiser {

jwtString, err := utils.GenerateLoginJwtString(utils.LoginJwtFields{
Username: "organiser!" + userInfo.Username,
Username: userInfo.Username,
UserType: OAUTH_TYPE_ORGANISER,
})

if err != nil {
Expand Down Expand Up @@ -143,6 +144,7 @@ func OAuth(w http.ResponseWriter, r *http.Request) {
// Generate a JWT string for the user
jwtString, err := utils.GenerateLoginJwtString(utils.LoginJwtFields{
Username: userInfo.Username,
UserType: userType,
})
if err != nil {
utils.LogErrAndRespond(r, w, err, "Error generating a JWT string.", http.StatusInternalServerError)
Expand Down

0 comments on commit 2e1ed95

Please sign in to comment.