[feature] New user sign-up via web page (#2796)

* [feature] User sign-up form and admin notifs

* add chosen + filtered languages to migration

* remove stray comment

* chosen languages schmosen schmanguages

* proper error on local account missing
This commit is contained in:
tobi 2024-04-11 11:45:53 +02:00 committed by GitHub
commit 9fb8a78f91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 1456 additions and 437 deletions

View file

@ -186,9 +186,13 @@ var Confirm action.GTSAction = func(ctx context.Context) error {
user.Approved = func() *bool { a := true; return &a }()
user.Email = user.UnconfirmedEmail
user.ConfirmedAt = time.Now()
user.SignUpIP = nil
return state.DB.UpdateUser(
ctx, user,
"approved", "email", "confirmed_at",
"approved",
"email",
"confirmed_at",
"sign_up_ip",
)
}

View file

@ -100,6 +100,10 @@ var Start action.GTSAction = func(ctx context.Context) error {
return fmt.Errorf("error creating instance instance: %s", err)
}
if err := dbService.CreateInstanceApplication(ctx); err != nil {
return fmt.Errorf("error creating instance application: %s", err)
}
// Get the instance account
// (we'll need this later).
instanceAccount, err := dbService.GetInstanceAccount(ctx, "")