summaryrefslogtreecommitdiff
path: root/internal/gtsmodel/user.go
diff options
context:
space:
mode:
authorLibravatar Dominik Süß <dominik@suess.wtf>2022-12-06 14:15:56 +0100
committerLibravatar GitHub <noreply@github.com>2022-12-06 14:15:56 +0100
commit199b685f430910910e43476caa9ccec6a441d020 (patch)
treeb928c97deae38f8194e51b5e7a69766ddd1a0763 /internal/gtsmodel/user.go
parent[feature] media: add webp support (#1155) (diff)
downloadgotosocial-199b685f430910910e43476caa9ccec6a441d020.tar.xz
[feature] overhaul the oidc system (#961)
* [feature] overhaul the oidc system this allows for more flexible username handling and prevents account takeover using old email addresses * [feature] add migration path for old OIDC users * [feature] nicer error reporting for users * [docs] document the new OIDC flow * [fix] return early on oidc error * [docs]: add comments on the finalization logic
Diffstat (limited to 'internal/gtsmodel/user.go')
-rw-r--r--internal/gtsmodel/user.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/gtsmodel/user.go b/internal/gtsmodel/user.go
index 0d108253a..94e222aaf 100644
--- a/internal/gtsmodel/user.go
+++ b/internal/gtsmodel/user.go
@@ -56,4 +56,5 @@ type User struct {
Approved *bool `validate:"-" bun:",nullzero,notnull,default:false"` // Has this user been approved by a moderator?
ResetPasswordToken string `validate:"required_with=ResetPasswordSentAt" bun:",nullzero"` // The generated token that the user can use to reset their password
ResetPasswordSentAt time.Time `validate:"required_with=ResetPasswordToken" bun:"type:timestamptz,nullzero"` // When did we email the user their reset-password email?
+ ExternalID string `validate:"-" 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)
}