mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
parent
02945f1e3b
commit
6d9ad56e6d
@ -2,7 +2,6 @@ package service
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
|
||||
kolide_errors "github.com/kolide/kolide-ose/server/errors"
|
||||
"github.com/kolide/kolide-ose/server/kolide"
|
||||
@ -77,7 +76,7 @@ func (svc service) VerifyInvite(ctx context.Context, email, token string) error
|
||||
|
||||
expiresAt := invite.CreatedAt.Add(svc.config.App.InviteTokenValidityPeriod)
|
||||
if svc.clock.Now().After(expiresAt) {
|
||||
return errors.New("expired invite token")
|
||||
return newInvalidArgumentError("invite_token", "Invite token has expired.")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -165,7 +165,7 @@ func TestCreateUser(t *testing.T) {
|
||||
NeedsPasswordReset: boolPtr(true),
|
||||
Admin: boolPtr(false),
|
||||
InviteToken: &invites["expired"].Token,
|
||||
wantErr: errors.New("expired invite token"),
|
||||
wantErr: &invalidArgumentError{{name: "invite_token", reason: "Invite token has expired."}},
|
||||
},
|
||||
{
|
||||
Username: stringPtr("@admin2"),
|
||||
|
Loading…
Reference in New Issue
Block a user