AccountController
AccountController exposes account login, reauthentication, and removal to the frontend. It stays limited to DTO conversion and feature invocation.
- Methods: 8
- Referenced types: 2
Methods
- CancelLogin
- CompleteTOTP
- ListAccounts
- Login
- ReauthenticateAccount
- RemoveAccount
- SetDefaultAccount
- ValidateAccount
CancelLogin
CancelLogin discards a pending sign-in flow.
Go
CancelLogin(flowID string) errorTypeScript
CancelLogin(flowID: string): Promise<void>Parameters
| Name | Type |
|---|---|
flowID | string |
Example
await CancelLogin("flow-id")Source
internal/transport/wails/account_controller.go:41
CompleteTOTP
CompleteTOTP finishes a sign-in flow with the user's one-time verification code.
Go
CompleteTOTP(flowID string, code string) (LoginResultDTO, error)TypeScript
CompleteTOTP(flowID: string, code: string): Promise<LoginResultDTO>Parameters
| Name | Type |
|---|---|
flowID | string |
code | string |
Returns
| Go type | TypeScript type |
|---|---|
LoginResultDTO | LoginResultDTO |
Example
const completeTOTP = await CompleteTOTP("flow-id", "")Source
internal/transport/wails/account_controller.go:35
ListAccounts
ListAccounts returns the launcher's saved accounts for account selection.
Go
ListAccounts() ([]AccountDTO, error)TypeScript
ListAccounts(): Promise<AccountDTO[]>Returns
| Go type | TypeScript type |
|---|---|
[]AccountDTO | AccountDTO[] |
Example
const listAccounts = await ListAccounts()Source
internal/transport/wails/account_controller.go:19
Login
Login starts an account sign-in flow and reports whether further verification is required.
Go
Login(email string, password string) (LoginResultDTO, error)TypeScript
Login(email: string, password: string): Promise<LoginResultDTO>Parameters
| Name | Type |
|---|---|
email | string |
password | string |
Returns
| Go type | TypeScript type |
|---|---|
LoginResultDTO | LoginResultDTO |
Example
const login = await Login("user@example.com", "")Source
internal/transport/wails/account_controller.go:29
ReauthenticateAccount
ReauthenticateAccount refreshes authentication for an existing saved account.
Go
ReauthenticateAccount(accountID string, email string, password string) (LoginResultDTO, error)TypeScript
ReauthenticateAccount(accountID: string, email: string, password: string): Promise<LoginResultDTO>Parameters
| Name | Type |
|---|---|
accountID | string |
email | string |
password | string |
Returns
| Go type | TypeScript type |
|---|---|
LoginResultDTO | LoginResultDTO |
Example
const reauthenticateAccount = await ReauthenticateAccount("account-id", "user@example.com", "")Source
internal/transport/wails/account_controller.go:62
RemoveAccount
RemoveAccount removes a saved account and its protected credentials.
Go
RemoveAccount(id string) errorTypeScript
RemoveAccount(id: string): Promise<void>Parameters
| Name | Type |
|---|---|
id | string |
Example
await RemoveAccount("id")Source
internal/transport/wails/account_controller.go:51
SetDefaultAccount
SetDefaultAccount selects the account used for future game launches.
Go
SetDefaultAccount(id string) errorTypeScript
SetDefaultAccount(id: string): Promise<void>Parameters
| Name | Type |
|---|---|
id | string |
Example
await SetDefaultAccount("id")Source
internal/transport/wails/account_controller.go:46
ValidateAccount
ValidateAccount checks whether a saved account can still authenticate.
Go
ValidateAccount(id string) (AccountDTO, error)TypeScript
ValidateAccount(id: string): Promise<AccountDTO>Parameters
| Name | Type |
|---|---|
id | string |
Returns
| Go type | TypeScript type |
|---|---|
AccountDTO | AccountDTO |
Example
const validateAccount = await ValidateAccount("id")Source
internal/transport/wails/account_controller.go:56