From the course: Learning Next.js
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Sign in with your Gmail account
From the course: Learning Next.js
Sign in with your Gmail account
So now we want to be able to connect. So when we click on this button. So it should be able to trigger the authentication process with Google. So it's going to open a new dialog box. We're going to go to another page. And from here you can select your account and then connect. Then come back to your application. Very simple. We're going to set this up. So let's go find here. So under components and then login you're going to find the AuthComponents. And this is where you're going to update those two buttons to sign in and sign out. So this is the one that we see right now here which is the sign in button. So first we're going to add to the scope the two actions. And we're going to import from.. So that's going to be first the objects we're going to import to...actions. And that's going to be from the Auth Config. right here. All right. So we want to then add to the scope these two functions to sign in first and sign out. All right. So let's update those two buttons. So we're going to…
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Getting started with NextAuth.js52s
-
(Locked)
Setting up NextAuth.js3m 19s
-
(Locked)
Creating the auth routes and components4m 27s
-
(Locked)
Adding the Google credentials provider5m 22s
-
(Locked)
Sign in with your Gmail account5m 49s
-
(Locked)
Challenge: Authenticate and create posts1m 54s
-
(Locked)
Solution: Authenticate and create posts7m 17s
-
(Locked)
Protecting pages and API routes6m 1s
-
(Locked)
-
-