Skip to content

Commit

Permalink
[WIP] also check for email
Browse files Browse the repository at this point in the history
  • Loading branch information
sunkup committed Jan 28, 2025
1 parent cbb4987 commit 092d0ee
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ data class LoginInfo(
*/
const val EXTRA_LOGIN_FLOW = "loginFlow"

/**
* When set, the account name field will be set to this value.
*/
fun shouldSkipLoginTypePage(intent: Intent): Boolean {
val info = fromIntent(intent)
val hasUrl = info.baseUri != null
return hasUrl
val hasEmail = info.credentials?.username?.contains('@') == true
return hasUrl || hasEmail
}

/**
Expand All @@ -65,6 +69,9 @@ data class LoginInfo(
val logger = Logger.getGlobal()
intent.data?.normalizeScheme()?.let { uri ->
try {
if (uri.scheme?.lowercase() == "mailto")
givenUsername = uri.schemeSpecificPart

// replace caldav[s]:// and carddav[s]:// with http[s]://
val realScheme = when (uri.scheme) {
"caldav", "carddav" -> "http"
Expand Down

0 comments on commit 092d0ee

Please sign in to comment.