Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add helpful exceptions for userland / traits #8

Conversation

jrushlow
Copy link
Collaborator

@jrushlow jrushlow commented May 1, 2020

  • AlreadyVerifiedException::class - Used if a users has already been verified.
  • InvalidSignatureException::class - Used anytime Helper::isValidSignature returns false.

These exception as more appropriate for user land code. But may prove useful in the yet to be written, VerifyEmailControllerTrait::class (PR #1)

Use case:

 if ($user->isVerified()) {
    throw new AlreadyVerifiedException();
}

if (!$helper->isValidSignature($request->getRequestUri(), $user->getId(), $user->getEmail())) {
    throw new InvalidSignatureException();
}

@weaverryan
Copy link
Contributor

If these were used in the trait in #1, then I'm all for them. But I just added some comments there that may make them not needed :)

@jrushlow jrushlow marked this pull request as draft May 4, 2020 16:02
@jrushlow
Copy link
Collaborator Author

jrushlow commented May 4, 2020

#1 and this PR are sort of in limbo. I'm coding these out in maker / test app. Converted this one to a draft until I have a better idea of what the implementation looks like.

Will provide the full context in the next go around...

@jrushlow
Copy link
Collaborator Author

no longer relevant

@jrushlow jrushlow closed this May 15, 2020
@jrushlow jrushlow deleted the feature/invalid-signature-exception branch May 25, 2020 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants