Skip to content

Commit

Permalink
HandleInertiaRequest fiunction
Browse files Browse the repository at this point in the history
  • Loading branch information
strstensky committed Feb 19, 2024
1 parent 2ea9236 commit 6eacfb3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pages/getting-started/upgrade-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ public function share(Request $request): array
// ...
]);
}

private function showTwoFactorAuthCTA(Request $request): bool
{
$showTwoFactorAuthCTA = false;

$twoFactorAuthRequired = $request->user('craftable-pro')
&& ! $request->user('craftable-pro')->hasEnabledTwoFactorAuthentication()
&& $request->user('craftable-pro')->hasRequiredTwoFactorAuthentication;

// the user will see the modal only once in 24 hours
if ($twoFactorAuthRequired && ! $request->cookie('twoFactorAuthCTAShown')) {
$showTwoFactorAuthCTA = true;
Cookie::queue('twoFactorAuthCTAShown', true, 60 * 24);
}

return $showTwoFactorAuthCTA;
}
```

### Run npm install and npm run craftable-pro:dev
Expand Down

0 comments on commit 6eacfb3

Please sign in to comment.