Commit f233bfb9 authored by Ankit Nayan's avatar Ankit Nayan
Browse files

chore: change in error message on register

Showing with 6 additions and 1 deletion
+6 -1
......@@ -125,7 +125,11 @@ func validateInvite(ctx context.Context, req *RegisterRequest) (*model.Invitatio
return nil, errors.Wrap(err.Err, "Failed to read from DB")
}
if invitation == nil || invitation.Token != req.InviteToken {
if invitation == nil {
return nil, ErrorAskAdmin
}
if invitation.Token != req.InviteToken {
return nil, ErrorInvalidInviteToken
}
......
......@@ -15,6 +15,7 @@ var (
ErrorInvalidRole = errors.New("Invalid role")
ErrorInvalidInviteToken = errors.New("Invalid invite token")
ErrorAskAdmin = errors.New("You are not allowed to create an account. Please ask your admin to send an invite link")
)
func randomHex(sz int) (string, error) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment