|
|
@ -3,7 +3,7 @@ package de.fd.fh.server.access; |
|
|
|
import de.fd.fh.server.access.events.AccountCreatedEvent; |
|
|
|
import de.fd.fh.server.access.events.AccountDeletedEvent; |
|
|
|
import de.fd.fh.server.user.UserId; |
|
|
|
import de.fd.fh.shared.network.messages.LoginRequest; |
|
|
|
import de.fd.fh.shared.network.messages.LoginResponse; |
|
|
|
import de.fd.fh.shared.network.messages.RegistrateRequest; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.bson.types.ObjectId; |
|
|
@ -97,7 +97,7 @@ public class AccessService extends Observable |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public LoginRequest authorization(final String header) |
|
|
|
public LoginResponse authorization(final String header) |
|
|
|
{ |
|
|
|
System.out.println("authorization"); |
|
|
|
final String auth = header.substring("Basic ".length()); |
|
|
@ -117,12 +117,12 @@ public class AccessService extends Observable |
|
|
|
access.setToken(AccessToken.of(access)); |
|
|
|
accessRepository.save(access); |
|
|
|
|
|
|
|
final LoginRequest loginRequest = new LoginRequest(); |
|
|
|
loginRequest.setUserId(access.getUserId().getIdentifier()); |
|
|
|
loginRequest.setToken(access.getToken().getToken()); |
|
|
|
loginRequest.setName(access.getName()); |
|
|
|
final LoginResponse loginResponse = new LoginResponse(); |
|
|
|
loginResponse.setUserId(access.getUserId().getIdentifier()); |
|
|
|
loginResponse.setToken(access.getToken().getToken()); |
|
|
|
loginResponse.setName(access.getName()); |
|
|
|
|
|
|
|
return loginRequest; |
|
|
|
return loginResponse; |
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|