Skip to content

Commit

Permalink
Issue grails#437 - Revert change for removeToken as it's not useful
Browse files Browse the repository at this point in the history
  • Loading branch information
longwa committed Apr 8, 2020
1 parent ff1a476 commit 71943a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class RestLogoutFilter extends GenericFilterBean {

try {
log.debug "Trying to remove the token"
tokenStorageService.removeToken accessToken
tokenStorageService.removeToken accessToken.accessToken
} catch (TokenNotFoundException ignored) {
servletResponse.sendError HttpServletResponse.SC_NOT_FOUND, "Token not found"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.springframework.security.core.userdetails.UserDetails
import org.springframework.security.core.Authentication

/**
* Implementations of this interface are responsible to load user information from a token storage system, and to store
* Implementations of this trait are responsible to load user information from a token storage system, and to store
* token information into it.
*/
trait TokenStorageService {
Expand Down Expand Up @@ -50,13 +50,5 @@ trait TokenStorageService {
* Removes a token from the storage.
* @throws TokenNotFoundException if the given token is not found in the storage
*/
void removeToken(String tokenValue) throws TokenNotFoundException {}

/**
* Remove the given accessToken from storage. Allows for handling of refresh token and other JWT claims as needed.
* @throws TokenNotFoundException if the given token is not found in the storage
*/
void removeToken(AccessToken accessToken) throws TokenNotFoundException {
removeToken(accessToken.accessToken)
}
abstract void removeToken(String tokenValue) throws TokenNotFoundException
}

0 comments on commit 71943a0

Please sign in to comment.