Skip to content

* Removed redundant code#2

Open
kesrishubham2510 wants to merge 1 commit intonavinreddy20:mainfrom
kesrishubham2510:fixRedundancy
Open

* Removed redundant code#2
kesrishubham2510 wants to merge 1 commit intonavinreddy20:mainfrom
kesrishubham2510:fixRedundancy

Conversation

@kesrishubham2510
Copy link
Copy Markdown

  • Replaced jwtService.validateToken(token, userDetails) call with jwtService.isTokenExpired(token)

Description

This `userName.equals(userDetails.getUsername()` is redundant because,

* Will always result in true
* The username is retrieved from the token in the JwtFilter
* The UserDetails argument is initialised in the JwtFilter by passing the same username retrieved from the received bearer token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant