auth

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthCompleteMsg

type AuthCompleteMsg struct{}

AuthCompleteMsg is emitted when authentication succeeds.

type CodeSubmittedMsg

type CodeSubmittedMsg struct {
	Code string
}

CodeSubmittedMsg is emitted when the user submits the verification code.

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the authentication flow component.

func New

func New(r theme.Roles, authorizer *telegram.TUIAuthorizer) Model

New creates a new auth model.

func (*Model) SetError

func (m *Model) SetError(err string)

SetError shows an error message on the auth screen (e.g. a failed login attempt surfaced from the Telegram client).

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize sets the component dimensions.

func (*Model) SetStep

func (m *Model) SetStep(step Step)

SetStep changes the auth step (called when the auth state changes).

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

Update handles messages.

func (Model) View

func (m Model) View() string

View renders the auth screen.

type PasswordSubmittedMsg

type PasswordSubmittedMsg struct {
	Password string
}

PasswordSubmittedMsg is emitted when the user submits their 2FA password.

type PhoneSubmittedMsg

type PhoneSubmittedMsg struct {
	Phone string
}

PhoneSubmittedMsg is emitted when the user submits their phone number.

type Step

type Step int

Step represents the current authentication step.

const (
	StepPhone Step = iota
	StepCode
	StepPassword
	StepQR
	StepLoading
	StepDone
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL