Skip to content

Commit

Permalink
Merge pull request #148 from DimensionSrl/feature/updates
Browse files Browse the repository at this point in the history
Sanitized emails
  • Loading branch information
dulvui authored Mar 5, 2024
2 parents 4a888c0 + dc3b1e4 commit 2958960
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion app/src/main/java/it/bz/noi/community/oauth/AuthManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ object AuthManager {
}
}

private fun Contact.matches(mail: String): Boolean = mail == email || mail == email2 || mail == email3
private fun Contact.matches(mail: String): Boolean {

// Mail can include garbage whitespaces.
fun String.sanitized() = trim()

return with (mail.sanitized()) {
equals(email?.sanitized(), true) || equals(email2?.sanitized(), true) || equals(email3?.sanitized(), true)
}
}

private suspend fun UserState.toStatus(): AuthStateStatus {
return when {
Expand Down
4 changes: 2 additions & 2 deletions app/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Tue Sep 28 07:39:37 UTC 2021
VERSION_CODE=20
#Fri Mar 1 08:48:00 UTC 2024
VERSION_CODE=21

0 comments on commit 2958960

Please sign in to comment.