android: show hex code for TV log in (#557)

Remove flag gating the display of a hex code for Android TV users, now that the change allowing hex code input in the admin console is merged.
Fixes tailscale/tailscale#13277

Signed-off-by: kari-ts <kari@tailscale.com>
main
kari-ts 3 days ago committed by GitHub
parent 4c4148bd8e
commit 08a062bfcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -23,7 +23,6 @@ class LoginQRViewModel : IpnViewModel() {
val numCode: StateFlow<String?> = MutableStateFlow(null)
val qrCode: StateFlow<ImageBitmap?> = MutableStateFlow(null)
// Remove this once changes to admin console allowing input code to be entered are made.
val codeEnabled = false
init {
viewModelScope.launch {
@ -31,17 +30,15 @@ class LoginQRViewModel : IpnViewModel() {
url?.let {
qrCode.set(generateQRCode(url, 200, 0))
if (codeEnabled) {
// Extract the string after "https://login.tailscale.com/a/"
val prefix = "https://login.tailscale.com/a/"
val code =
if (it.startsWith(prefix)) {
it.removePrefix(prefix)
} else {
null
}
numCode.set(code)
}
// Extract the string after "https://login.tailscale.com/a/"
val prefix = "https://login.tailscale.com/a/"
val code =
if (it.startsWith(prefix)) {
it.removePrefix(prefix)
} else {
null
}
numCode.set(code)
}
?: run {
qrCode.set(null)

Loading…
Cancel
Save