- Timestamp:
- 09/11/22 18:03:58 (2 years ago)
- Branches:
- master
- Children:
- 775e15e
- Parents:
- 527b93f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
phonelux-backend/src/main/java/finki/it/phoneluxbackend/security/CustomAuthenticationFilter.java
r527b93f re5b84dc 33 33 @Override 34 34 public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { 35 String email = request.getParameter("email"); // mozda ke treba da se smeni vo username35 String email = request.getParameter("email"); 36 36 String password = request.getParameter("password"); 37 37 UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(email,password); … … 46 46 String access_token = JWT.create() 47 47 .withSubject(user.getEmail()) 48 .withExpiresAt(new Date(System.currentTimeMillis() + 10 * 60 * 1000 ))48 .withExpiresAt(new Date(System.currentTimeMillis() + 10 * 60 * 100000)) // approx. 16.5 hours 49 49 .withIssuer(request.getRequestURL().toString()) 50 50 .withClaim("role", user.getAuthorities().stream()
Note:
See TracChangeset
for help on using the changeset viewer.