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
Post a Comment