-
Notifications
You must be signed in to change notification settings - Fork 21
JWT Handler Response Format Fix #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,13 +14,14 @@ component extends="coldbox.system.RestHandler" { | |||||||
| function refreshToken( event, rc, prc ){ | ||||||||
| // If endpoint not enabled, just 404 it | ||||||||
| if ( !variables.jwtService.getSettings().jwt.enableRefreshEndpoint ) { | ||||||||
| return event | ||||||||
| event | ||||||||
| .getResponse() | ||||||||
| .setErrorMessage( | ||||||||
| "Refresh Token Endpoint Disabled", | ||||||||
| 404, | ||||||||
| "Disabled" | ||||||||
| ); | ||||||||
| return; | ||||||||
| } | ||||||||
|
|
||||||||
| try { | ||||||||
|
|
@@ -32,27 +33,31 @@ component extends="coldbox.system.RestHandler" { | |||||||
| .setData( prc.newTokens ) | ||||||||
| .addMessage( "Tokens refreshed! The passed in refresh token has been invalidated" ); | ||||||||
| } catch ( RefreshTokensNotActive e ) { | ||||||||
| return event.getResponse().setErrorMessage( "Refresh Tokens Not Active", 404, "Disabled" ); | ||||||||
| event.getResponse().setErrorMessage( "Refresh Tokens Not Active", 404, "Disabled" ); | ||||||||
| } catch ( TokenNotFoundException e ) { | ||||||||
| return event | ||||||||
| event | ||||||||
| .getResponse() | ||||||||
| .setErrorMessage( | ||||||||
| "The refresh token was not passed via the header or the rc. Cannot refresh the unrefreshable!", | ||||||||
| 400, | ||||||||
| "Missing refresh token" | ||||||||
| ); | ||||||||
|
||||||||
| ); | |
| ); | |
| return; |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Missing explicit return; statement for consistency. Line 24 includes an explicit return; after setting the error message. For consistency across all error paths in this function, consider adding return; after line 52.
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Missing explicit return; statement for consistency. Line 24 includes an explicit return; after setting the error message. For consistency across all error paths in this function, consider adding return; after line 60.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Missing explicit
return;statement for consistency. Line 24 includes an explicitreturn;after setting the error message. For consistency across all error paths in this function, consider addingreturn;here as well.