-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodules.go
More file actions
39 lines (34 loc) · 883 Bytes
/
modules.go
File metadata and controls
39 lines (34 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package user
import (
"github.com/tinywasm/fmt"
"github.com/tinywasm/form"
"github.com/tinywasm/form/input"
)
var uiModules []any
func init() {
form.RegisterInput(
input.Password(),
input.Password(),
input.Password(),
)
uiModules = []any{
&loginModule{form: mustForm("login", &LoginData{})},
®isterModule{form: mustForm("register", &RegisterData{})},
&profileModule{
form: mustForm("profile", &ProfileData{}),
passwordForm: mustForm("password", &PasswordData{}),
},
&lanModule{},
&oauthModule{},
}
}
// UIModules returns all standard authentication UI flow handlers.
// Isomorphic: available in both WASM and non-WASM builds.
func UIModules() []any { return uiModules }
func mustForm(parentID string, s fmt.Fielder) *form.Form {
f, err := form.New(parentID, s)
if err != nil {
panic("user: mustForm: " + err.Error())
}
return f
}