Implement a password reset flow.

This commit is contained in:
Me Car 2016-01-10 20:00:08 +09:00
parent 23d47be04c
commit 746d034461
14 changed files with 900 additions and 37 deletions

View file

@ -14,7 +14,7 @@ import org.apache.shiro.crypto.hash.Hash;
@DatabaseTable(tableName = "authorized_user")
public class AuthorizedUser {
@DatabaseField(indexName = "name_index")
@DatabaseField(indexName = "name_index", unique = true)
protected String name;
@DatabaseField
@ -29,7 +29,7 @@ public class AuthorizedUser {
@DatabaseField
protected int hashIterations;
@DatabaseField
@DatabaseField(indexName = "email_index", unique = true)
protected String email;
public AuthorizedUser() {
@ -53,4 +53,8 @@ public class AuthorizedUser {
ByteSource.Util.bytes(Base64.decode(this.salt)), "");
return matcher.doCredentialsMatch(token, info);
}
public String getName() {
return this.name;
}
}