Hinzufügen von Spring Security Login und Registierung. Basis implementierung von User und zugehörige DatenTransferObjekte.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package SuMoC.backend.security.models;
|
||||
|
||||
import SuMoC.backend.models.dto.UserDTO;
|
||||
|
||||
public class LoginResponseDTO {
|
||||
|
||||
//TODO: Change to needed UserInformation
|
||||
private UserDTO userDTO;
|
||||
private String jwt;
|
||||
|
||||
public LoginResponseDTO(UserDTO userDTO, String jwt){
|
||||
this.userDTO = userDTO;
|
||||
this.jwt = jwt;
|
||||
}
|
||||
|
||||
public UserDTO getUserDTO() {
|
||||
return userDTO;
|
||||
}
|
||||
|
||||
public void setUserDTO(UserDTO userDTO) {
|
||||
this.userDTO = userDTO;
|
||||
}
|
||||
|
||||
public String getJwt() {
|
||||
return jwt;
|
||||
}
|
||||
|
||||
public void setJwt(String jwt) {
|
||||
this.jwt = jwt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package SuMoC.backend.security.models;
|
||||
|
||||
public class UserAuthenticationPairDTO {
|
||||
|
||||
private String email;
|
||||
private String password;
|
||||
|
||||
public UserAuthenticationPairDTO(String email, String password){
|
||||
this.email = email;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package SuMoC.backend.security.models;
|
||||
|
||||
public class UserRegistrationDTO {
|
||||
|
||||
private String username;
|
||||
private String email;
|
||||
private String password;
|
||||
|
||||
public UserRegistrationDTO(String username, String email, String password){
|
||||
this.username = username;
|
||||
this.email = email;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user