Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aryehraber authored Jun 18, 2024
1 parent 74a6d46 commit b1b10f5
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,34 @@ class MyCustomShouldVerify implements CustomShouldVerify
{
public function __invoke($event): ?bool
{
if ($event instanceof \Statamic\Events\FormSubmitted) {
return auth()->guest();
// bypass verification for authenticated users
if (auth()->check()) {
return false;
}

// bypass verification on dev environment
if (app()->environment('dev')) {
return false;
}

// bypass verification based on event form submission
if ($event instanceof FormSubmitted) {
// return $event->submission;
}

// bypass verification based on login event
if ($event instanceof Login) {
// return $event->user;
}

// bypass verification based on user registration event
if ($event instanceof UserRegistering) {
// return $event->user;
}

// bypass verification based on entry saving event
if ($event instanceof EntrySaving) {
// return $event->entry;
}
}
}
Expand Down

0 comments on commit b1b10f5

Please sign in to comment.