This commit is contained in:
Tben
2023-06-24 13:09:26 +01:00
parent 6b6b924cc9
commit 4b826728ab
10 changed files with 286 additions and 358 deletions
+4 -4
View File
@@ -170,12 +170,12 @@ module.exports = async function ({ key, token, database, clientId, response, enc
encryptionSalt,
});
const { user } = httpResponse;
const { user, dsqlUserId } = httpResponse;
const authKeyName = `datasquirel_${user.id}_${database}_auth_key`;
const csrfName = `datasquirel_${user.id}_${database}_csrf`;
const authKeyName = `datasquirel_${dsqlUserId}_${database}_auth_key`;
const csrfName = `datasquirel_${dsqlUserId}_${database}_csrf`;
response.setHeader("Set-Cookie", [`${authKeyName}=${encryptedPayload};samesite=strict;path=/;HttpOnly=true;Secure=true`, `${csrfName}=${httpResponse.user.csrf_k};samesite=strict;path=/;sHttpOnly=true`, `dsqluid=${user.id};samesite=strict;path=/;HttpOnly=true`]);
response.setHeader("Set-Cookie", [`${authKeyName}=${encryptedPayload};samesite=strict;path=/;HttpOnly=true;Secure=true`, `${csrfName}=${user.csrf_k};samesite=strict;path=/;HttpOnly=true`, `dsqluid=${dsqlUserId};samesite=strict;path=/;HttpOnly=true`, `datasquirel_social_id=${user.social_id};samesite=strict;path=/`]);
}
////////////////////////////////////////