Skip to content

Commit

Permalink
Fix runtime error when activation key is expired (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
InfiniteStash authored Jan 10, 2025
1 parent 0d51817 commit 1e937d2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/user/activation.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,15 @@ func ActivateNewUser(fac models.Repo, name string, id uuid.UUID, password string
if err != nil {
return nil, err
}
if t == nil || t.Type != models.UserTokenTypeNewUser {
return nil, ErrInvalidActivationKey
}

data, err := t.GetNewUserTokenData()
if err != nil {
return nil, err
}

if t == nil || t.Type != models.UserTokenTypeNewUser {
return nil, ErrInvalidActivationKey
}

var invitedBy *uuid.UUID
if config.GetRequireInvite() {
if data.InviteKey == nil {
Expand Down

0 comments on commit 1e937d2

Please sign in to comment.