summaryrefslogtreecommitdiff
path: root/internal/gtsmodel/user.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-09-04 15:55:17 +0200
committerLibravatar GitHub <noreply@github.com>2023-09-04 14:55:17 +0100
commit3ed1ca68e52527f74103e1a57ae48ae533508c3a (patch)
treed6113d71d6f88a3d99bbd2215ead6ca1d4fa6153 /internal/gtsmodel/user.go
parent[chore]: Bump golang.org/x/image from 0.11.0 to 0.12.0 (#2178) (diff)
downloadgotosocial-3ed1ca68e52527f74103e1a57ae48ae533508c3a.tar.xz
[feature] Store admin actions in the db, prevent conflicting actions (#2167)
Diffstat (limited to 'internal/gtsmodel/user.go')
-rw-r--r--internal/gtsmodel/user.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/gtsmodel/user.go b/internal/gtsmodel/user.go
index 16c4d4ee2..7d3da555c 100644
--- a/internal/gtsmodel/user.go
+++ b/internal/gtsmodel/user.go
@@ -57,3 +57,23 @@ type User struct {
ResetPasswordSentAt time.Time `bun:"type:timestamptz,nullzero"` // When did we email the user their reset-password email?
ExternalID string `bun:",nullzero,unique"` // If the login for the user is managed externally (e.g OIDC), we need to keep a stable reference to the external object (e.g OIDC sub claim)
}
+
+// NewSignup models parameters for the creation
+// of a new user + account on this instance.
+//
+// Aside from username, email, and password, it is
+// fine to use zero values on fields of this struct.
+type NewSignup struct {
+ Username string // Username of the new account.
+ Email string // Email address of the user.
+ Password string // Plaintext (not yet hashed) password for the user.
+
+ Reason string // Reason given by the user when submitting a sign up request (optional).
+ PreApproved bool // Mark the new user/account as preapproved (optional)
+ SignUpIP net.IP // IP address from which the sign up request occurred (optional).
+ Locale string // Locale code for the new account/user (optional).
+ AppID string // ID of the application used to create this account (optional).
+ EmailVerified bool // Mark submitted email address as already verified (optional).
+ ExternalID string // ID of this user in external OIDC system (optional).
+ Admin bool // Mark new user as an admin user (optional).
+}