summaryrefslogtreecommitdiff
path: root/internal/client/ui/auth/auth.go
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-01-06 18:23:41 +0200
committerKyren223 <Kyren223@proton.me>2025-01-06 18:23:41 +0200
commit63790c069fbca0c3548fdaa58148e6cefdf477d5 (patch)
tree8ba0e84d0334e13fcb36134789791dadfb0bfde7 /internal/client/ui/auth/auth.go
parent1a218730e9a0c16fd71f4606adfde5862be2e7b7 (diff)
Server and client now properly handle the same user logging in from
different locations, fixed the issue where it'd only work for the first time by checking if the addresses match before remove the session
Diffstat (limited to 'internal/client/ui/auth/auth.go')
-rw-r--r--internal/client/ui/auth/auth.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/internal/client/ui/auth/auth.go b/internal/client/ui/auth/auth.go
index 42ea3e5..3f89298 100644
--- a/internal/client/ui/auth/auth.go
+++ b/internal/client/ui/auth/auth.go
@@ -80,14 +80,22 @@ ___] | |__] | \| | | \|`)
centerStyle = lipgloss.NewStyle().Width(authWidth).AlignHorizontal(0.5)
)
+func init() {
+ // HACK: to avoid a circular dependency, so core can transition to this
+ // I don't like how go has this issue, I would rather slower compilations
+ ui.NewAuth = func() tea.Model {
+ return New()
+ }
+}
+
type Model struct {
- focusIndex int
+ popup *choicepopup.Model
+
fields []authfield.Model
+ focusIndex int
remember bool
signup bool
-
- popup *choicepopup.Model
}
func New() Model {