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:
@@ -12,6 +12,7 @@ const populate_list = [
|
||||
'shipper',
|
||||
'carrier',
|
||||
'vehicle',
|
||||
{ path:'vehicle' , populate : { path : 'driver' } },
|
||||
'bidder',
|
||||
'accepted_by'
|
||||
];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"authentication": {
|
||||
"pwdSecret":"Nx2g_IWo2Zt_LS$+",
|
||||
"jwtSecret":"9o3BBz0EsrwXliwEJ/SFuywZoN8=",
|
||||
"jwtSecret":"9o3BBz0EsrwXXiwEJ/SFuywZoN8=",
|
||||
"jwtTimeout":24,
|
||||
"jwtRenewalTimeout":720,
|
||||
"tokenSecret":"9Z'jMt|(h_f(&/S+zv.K",
|
||||
@@ -16,9 +16,9 @@
|
||||
}
|
||||
},
|
||||
"version" : {
|
||||
"version" : "1.1.1",
|
||||
"version" : "2.0.0",
|
||||
"name": "ETA Beta",
|
||||
"date":"03/2024"
|
||||
"date":"08/2024"
|
||||
},
|
||||
"S3" : {
|
||||
"accessKeyId": "AKIAXTQEUF6MLCHTUIKW",
|
||||
|
||||
@@ -41,7 +41,11 @@ class SpecificModelRepository{
|
||||
.where("email","=",email)
|
||||
.where("password","=",safe_password)
|
||||
.first();
|
||||
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 );
|
||||
if( user ){
|
||||
return await this.populate( user );
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user