-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from integratedmodelling/IM-73-Users-dont-use…
…-email-as-unique-and-primary-key-2 Im 73 users dont use email as unique and primary key 2
- Loading branch information
Showing
28 changed files
with
667 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
klab.hub/src/main/java/org/integratedmodelling/klab/hub/api/CreateVerifyEmailToken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.integratedmodelling.klab.hub.api; | ||
|
||
import org.integratedmodelling.klab.hub.commands.CreateTokenCommand; | ||
import org.integratedmodelling.klab.hub.config.LinkConfig; | ||
import org.integratedmodelling.klab.hub.repository.TokenRepository; | ||
|
||
public class CreateVerifyEmailToken extends CreateTokenCommand { | ||
|
||
private TokenRepository tokenRepository; | ||
private String username; | ||
private String email; | ||
|
||
public CreateVerifyEmailToken(TokenRepository tokenRepository, String username, | ||
LinkConfig linkConfig) { | ||
this.tokenRepository = tokenRepository; | ||
this.username = username; | ||
setLinkConfig(linkConfig); | ||
} | ||
|
||
public CreateVerifyEmailToken(TokenRepository tokenRepository, String username, String email, LinkConfig linkConfig) { | ||
this.tokenRepository = tokenRepository; | ||
this.username = username; | ||
this.email = email; | ||
setLinkConfig(linkConfig); | ||
} | ||
|
||
@Override | ||
public TokenVerifyEmailClickback execute() { | ||
|
||
TokenVerifyEmailClickback token = new TokenVerifyEmailClickback(username, email); | ||
token.setCallbackUrl(getLinkConfig()); | ||
token.setAuthenticated(true); | ||
tokenRepository.save(token); | ||
return token; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 21 additions & 3 deletions
24
klab.hub/src/main/java/org/integratedmodelling/klab/hub/api/TokenVerifyEmailClickback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,40 @@ | ||
package org.integratedmodelling.klab.hub.api; | ||
|
||
import org.integratedmodelling.klab.hub.config.LinkConfig; | ||
import org.springframework.data.annotation.TypeAlias; | ||
|
||
@TypeAlias("VerifyEmail") | ||
public class TokenVerifyEmailClickback extends TokenClickback { | ||
|
||
private static final long serialVersionUID = 2577854654763037014L; | ||
private String newEmail; | ||
|
||
|
||
|
||
public TokenVerifyEmailClickback(String username) { | ||
public TokenVerifyEmailClickback(String username, String newEmail) { | ||
super(username); | ||
this.newEmail = newEmail; | ||
} | ||
|
||
public void setNewEmailAddress(String newEmailAddress) { | ||
|
||
|
||
@Override | ||
public String getSuccessUrl(LinkConfig tokenClickbackConfig) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public ClickbackAction getClickbackAction() { | ||
return null; | ||
return ClickbackAction.changeEmail; | ||
} | ||
|
||
public String getNewEmail() { | ||
return newEmail; | ||
} | ||
|
||
public void setNewEmail(String newEmail) { | ||
this.newEmail = newEmail; | ||
} | ||
|
||
|
||
} |
26 changes: 26 additions & 0 deletions
26
klab.hub/src/main/java/org/integratedmodelling/klab/hub/payload/UpdateEmailRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.integratedmodelling.klab.hub.payload; | ||
|
||
import org.integratedmodelling.klab.rest.UserAuthenticationRequest; | ||
|
||
public class UpdateEmailRequest extends UserAuthenticationRequest{ | ||
|
||
public String email; | ||
public String token; | ||
|
||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
public void setEmail(String email) { | ||
this.email = email; | ||
} | ||
|
||
public String getToken() { | ||
return token; | ||
} | ||
|
||
public void setToken(String token) { | ||
this.token = token; | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
klab.hub/src/main/java/org/integratedmodelling/klab/hub/payload/UpdateEmailResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.integratedmodelling.klab.hub.payload; | ||
|
||
public class UpdateEmailResponse { | ||
|
||
private String email; | ||
private String newEmail; | ||
|
||
|
||
public UpdateEmailResponse() { | ||
super(); | ||
} | ||
|
||
public UpdateEmailResponse(String email, String newEmail) { | ||
super(); | ||
this.email = email; | ||
this.newEmail = newEmail; | ||
} | ||
|
||
public String getEmail() { | ||
return email; | ||
} | ||
public void setEmail(String email) { | ||
this.email = email; | ||
} | ||
public String getNewEmail() { | ||
return newEmail; | ||
} | ||
public void setNewEmail(String newEmail) { | ||
this.newEmail = newEmail; | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.