Skip to content

Commit

Permalink
Merge pull request #45 from WISVCH/fix-permission-denied
Browse files Browse the repository at this point in the history
On permission denied show user message accordingly
  • Loading branch information
julian9499 authored Feb 21, 2022
2 parents 7a52b6a + 4298f6c commit d7e6ee6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ func callbackController(a *App) gin.HandlerFunc {
"token": rawIDToken,
})
} else {
c.AbortWithStatus(http.StatusUnauthorized)
_, err := c.Writer.WriteString("permission denied")
if err != nil {
log.Errorf("unable to write response to user")
c.AbortWithStatus(http.StatusUnauthorized)
return
}
c.Status(http.StatusUnauthorized)
}
}
}
Expand Down

0 comments on commit d7e6ee6

Please sign in to comment.