spring boot - Thymeleaf: Login user via sign up page instead of /login -


so far know works automatically, don't know how use if had created new user via sign page. instead of taking user log in page again. there way log in user automatically on sign up.

as part of register user, can manually stuff new authentication object securitycontextholder. keep user having log in manually.

// build authentication token based on username , password provided collection authorities = new arraylist<>(); authorities.add(new simplegrantedauthority("user")); authentication auth = new usernamepasswordauthenticationtoken(email, password, authorities); // set authentication in context securitycontextholder.getcontext().setauthentication(auth);


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -