fix: Make v2 JWT incompatible with v1
- fix(Proposals): Populating driver data. - fix(Account): Make v1 and v2 JWT secret incompatible.
This commit is contained in:
@@ -41,7 +41,11 @@ class SpecificModelRepository{
|
||||
.where("email","=",email)
|
||||
.where("password","=",safe_password)
|
||||
.first();
|
||||
return await this.populate( user );
|
||||
if( user ){
|
||||
return await this.populate( user );
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async updateSessionToken( old_token, token, expiration ){
|
||||
@@ -81,7 +85,11 @@ class SpecificModelRepository{
|
||||
async findBySessionToken( token ){
|
||||
const session = await Sessions.query().select("*").where("token","=",token).first();
|
||||
const user = await Users.query().findById( session.user_id );
|
||||
return await this.populate( user );
|
||||
if( user ){
|
||||
return await this.populate( user );
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user