Ignore:
Timestamp:
02/04/23 19:28:58 (23 months ago)
Author:
milamihajlovska <mila.mihajlovska01@…>
Branches:
master
Children:
a554435
Parents:
6032d44
Message:

login and register in HomeController

Location:
src/main/java/com/example/moviezone/service
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/moviezone/service/Impl/UserServiceImpl.java

    r6032d44 re097c1c  
    44import com.example.moviezone.model.User;
    55import com.example.moviezone.model.Worker;
     6import com.example.moviezone.model.exceptions.PasswordsDoNotMatchException;
    67import com.example.moviezone.model.exceptions.UserNotFoundException;
    78import com.example.moviezone.repository.UserRepository;
     
    3940
    4041    @Override
    41     public User register(String first_name, String last_name, String username, String email, String number, String password, String role) {
     42    public User register(String first_name, String last_name, String username, String email, String number, String password,String repeatedPassword, String role) {
     43       if(!password.equals(repeatedPassword))
     44           throw new PasswordsDoNotMatchException();
     45       else
    4246        if(role.equals("worker"))
    4347        {
  • src/main/java/com/example/moviezone/service/UserService.java

    r6032d44 re097c1c  
    1010    User findByUsername(String username);
    1111
    12   User register(String first_name, String last_name,String username, String email, String number, String password, String role);
     12  User register(String first_name, String last_name,String username, String email, String number, String password,String repeatedPassword, String role);
    1313    User login(String username,String password);
    1414}
Note: See TracChangeset for help on using the changeset viewer.