This episode is for members only

Sign up to access "Build a Starter Kit With Inertia and Fortify" right now.

Get started
Already a member? Sign in to continue
Playing
36. Adding a verification notice

Episodes

0%
Your progress
  • Total: 5h 21m
  • Played: 0m
  • Remaining: 5h 21m
Join or sign in to track your progress

Transcript

00:00
OK, so once again, we can solve this issue where we don't have a route defined by creating out a modal and going ahead
00:08
and adding this to our Fortify service provider and then moving the route over like we've done a few times already. So let's get started on this by going over to our Fortify service provider. And we're going to go ahead and use Fortify again here.
00:23
And this time we are looking for the verify email view. So this is going to work in exactly the same way. And again, we're going to need that controller because that controller returns the response, which is responsible
00:36
for hooking this up to the container and then running what is inside of this closure. So we're going to do exactly the same thing again. And let's go ahead and just choose a name for this. Let's call this verify email.
00:48
And we'll go ahead and create this verify email modal out. And of course, it doesn't need to be a modal. You could choose pretty much anything. So let's go ahead and create verify email
00:57
view, and again, we'll just copy this from somewhere else. So let's choose the confirm password one. Let's pop this in here. And we're not going to have a continue button that is going to become
01:09
the button which triggers the recent of the email. So I'm going to change the title here to verify your email. And let's go ahead and get rid of this field because we're definitely not going to need that.
01:21
We will need a form and let's just say verify your email. OK, so we'll just keep it like that. Let's get rid of this form because we're not going to need to post anything down here and we can get rid of the use modal stuff as well.
01:36
OK, so now that we've got our form, let's go and just try this again. And we already know that we need to define the route here. So this still isn't going to work. So once again, let's head over to our fortify routes.
01:48
Let's find our confirm email or confirm. See what it's called. Let's just have a search down here and we should see it might be email verification. So let's say, yeah, let's have a look here.
02:05
And we yeah, so we've got this verification notice again wrapped in our enable views. So we're going to move that over to our fortify routes so this can be used and once again, we're going to need to make sure to pull this control room before we forget and make sure that this is only
02:22
enabled if this feature is enabled, so this route is registered if the feature is enabled, so we should be good if we head over now and click on our dashboard. We see our modal. Great. So that's that. So really simple to do.
02:36
Let's just go ahead and finish off the verify email here. We're going to go ahead and say resend email and we'll get rid of this because we're not quite sure what we're doing here yet. And let's go ahead and add in a little notice in here.
02:51
So I've already got some copy in here that I can just pull over and that you'll need to verify your email before accessing that and we'll just set the text to small. So let's head over and check this out. And yeah, that's not working.
03:05
Let's get rid of the disabled part of this because we're not too sure what we're doing with this just yet. In fact, let's bring back our form. So we'll go ahead and bring our form back in there.
03:19
We might be able to use that. So let's say use form and we'll just put an empty object in there for now. OK, so there we go. We've got when we click on dashboard, verify your email.
03:29
And of course, clicking this button will resend the email. So now that we've done that again and we've replaced out this view with a modal, let's head over to the next episode and figure out how we can click this to resend an email if the user didn't receive one.

Episode summary

In this episode, we tackle adding a verification notice for users who need to confirm their email before accessing certain parts of the app. We walk through moving the email verification view into a modal, so users get a nice user interface prompt right when they need it.

We'll update our Fortify service provider, set up the needed routes, and create a dedicated modal (or view—your choice!) for verifying emails. Most of the process is similar to things we've done before, so you'll see a lot of copy-pasting and tweaking from our confirm password modal. We also make sure this new route is only set up if the right features are enabled.

You'll see how to add instructions and a "resend email" button (though wiring up the actual resend action comes in the next episode). By the end, clicking on the dashboard brings up our verify email modal, complete with guidance for the user. All that's left is hooking up the resend functionality, which is what's coming up next!

Episode discussion

No comments, yet. Be the first!