Update framework -> move jwt depdencies from user
This commit is contained in:
parent
def51bbf25
commit
9c0ffb62c6
3 changed files with 4 additions and 3 deletions
Binary file not shown.
|
@ -59,18 +59,20 @@ public class Main{
|
|||
for(Entry<String, Object> entry : json.entries()) params.put(entry.getKey(), entry.getValue());
|
||||
auth = new JwtAuthenticator<PeerAtUser>().configure(
|
||||
(builder) -> builder.setExpectedIssuer(config.getTokenIssuer()),
|
||||
(claims) -> {
|
||||
(claims, user) -> {
|
||||
claims.setIssuer(config.getTokenIssuer());
|
||||
claims.setExpirationTimeMinutesInTheFuture(config.getTokenExpiration());
|
||||
user.write(claims);
|
||||
},
|
||||
(claims) -> new PeerAtUser(claims),
|
||||
params);
|
||||
}else{
|
||||
auth = new JwtAuthenticator<PeerAtUser>().configure(
|
||||
(builder) -> builder.setExpectedIssuer(config.getTokenIssuer()),
|
||||
(claims) -> {
|
||||
(claims, user) -> {
|
||||
claims.setIssuer(config.getTokenIssuer());
|
||||
claims.setExpirationTimeMinutesInTheFuture(config.getTokenExpiration());
|
||||
user.write(claims);
|
||||
},
|
||||
(claims) -> new PeerAtUser(claims));
|
||||
JsonMap json = new JsonMap();
|
||||
|
|
|
@ -14,7 +14,6 @@ public class PeerAtUser extends dev.peerat.framework.User{
|
|||
this.id = ((Long) claims.getClaimValue("id")).intValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JwtClaims claims){
|
||||
claims.setClaim("id", this.id);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue