Force OpenID UID to be lowercase
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-10-19 09:35:49 -05:00
parent 8f1bbfef56
commit 6b3339a883
2 changed files with 8 additions and 4 deletions

View File

@@ -18,6 +18,10 @@ class CoreIDAdapter {
expiresAt = new Date(Date.now() + (expiresIn * 1000))
}
if ( payload.uid ) {
payload.uid = payload.uid.toLowerCase()
}
await this.coll().updateOne(
{ _id },
{ $set: { payload, ...(expiresAt ? { expiresAt } : undefined) } },
@@ -49,7 +53,7 @@ class CoreIDAdapter {
async findByUid(uid) {
const result = await this.coll().find(
{ 'payload.uid': uid },
{ 'payload.uid': uid.toLowerCase() },
{ payload: 1 },
).limit(1).next()