[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
parent a483bd9e38
commit 9fb8a78f91
68 changed files with 1456 additions and 437 deletions

View File

@@ -19,6 +19,7 @@ package db
import (
"context"
"time"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
)
@@ -36,7 +37,7 @@ type Admin interface {
// C) something went wrong in the db
IsEmailAvailable(ctx context.Context, email string) (bool, error)
// NewSignup creates a new user in the database with the given parameters.
// NewSignup creates a new user + account in the database with the given parameters.
// By the time this function is called, it should be assumed that all the parameters have passed validation!
NewSignup(ctx context.Context, newSignup gtsmodel.NewSignup) (*gtsmodel.User, error)
@@ -50,6 +51,23 @@ type Admin interface {
// This is needed for things like serving instance information through /api/v1/instance
CreateInstanceInstance(ctx context.Context) error
// CreateInstanceApplication creates an application in the database
// for use in processing signups etc through the sign-up form.
CreateInstanceApplication(ctx context.Context) error
// GetInstanceApplication gets the instance application
// (ie., the application owned by the instance account).
GetInstanceApplication(ctx context.Context) (*gtsmodel.Application, error)
// CountApprovedSignupsSince counts the number of new account
// sign-ups approved on this instance since the given time.
CountApprovedSignupsSince(ctx context.Context, since time.Time) (int, error)
// CountUnhandledSignups counts the number of account sign-ups
// that have not yet been approved or denied. In other words,
// the number of pending sign-ups sitting in the backlog.
CountUnhandledSignups(ctx context.Context) (int, error)
/*
ACTION FUNCS
*/