Make UID case-insensitive
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-10-18 23:27:23 -05:00
parent 2d97b77bbf
commit 97096f619f
14 changed files with 32 additions and 31 deletions

View File

@@ -49,7 +49,7 @@ class CoreIDAdapter {
async findByUid(uid) {
const result = await this.coll().find(
{ 'payload.uid': uid },
{ 'payload.uid': uid.toLowerCase() },
{ payload: 1 },
).limit(1).next()

View File

@@ -43,7 +43,7 @@ class FlitterProfileMapper {
getClaims() {
const claims = {}
claims[this.map.nameIdentifier] = this.user.uid
claims[this.map.nameIdentifier] = this.user.uid.toLowerCase()
claims[this.map.email] = this.user.email
claims[this.map.name] = `${this.user.first_name} ${this.user.last_name}`
claims[this.map.givenname] = this.user.first_name
@@ -54,7 +54,7 @@ class FlitterProfileMapper {
}
getNameIdentifier() {
return { nameIdentifier: this.user.uid }
return { nameIdentifier: this.user.uid.toLowerCase() }
}
}