File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ func (controller *OIDCController) Token(c *gin.Context) {
231231 if ! ok {
232232 tlog .App .Error ().Msg ("Missing authorization header" )
233233 c .Header ("www-authenticate" , "basic" )
234- c .JSON (401 , gin.H {
234+ c .JSON (400 , gin.H {
235235 "error" : "invalid_client" ,
236236 })
237237 return
@@ -313,15 +313,15 @@ func (controller *OIDCController) Token(c *gin.Context) {
313313 if err != nil {
314314 if errors .Is (err , service .ErrTokenExpired ) {
315315 tlog .App .Error ().Err (err ).Msg ("Refresh token expired" )
316- c .JSON (401 , gin.H {
316+ c .JSON (400 , gin.H {
317317 "error" : "invalid_grant" ,
318318 })
319319 return
320320 }
321321
322322 if errors .Is (err , service .ErrInvalidClient ) {
323323 tlog .App .Error ().Err (err ).Msg ("Invalid client" )
324- c .JSON (401 , gin.H {
324+ c .JSON (400 , gin.H {
325325 "error" : "invalid_grant" ,
326326 })
327327 return
@@ -337,6 +337,9 @@ func (controller *OIDCController) Token(c *gin.Context) {
337337 tokenResponse = tokenRes
338338 }
339339
340+ c .Header ("cache-control" , "no-store" )
341+ c .Header ("pragma" , "no-cache" )
342+
340343 c .JSON (200 , tokenResponse )
341344}
342345
You can’t perform that action at this time.
0 commit comments