今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Adding an OAuth URL route
- [Instructor] All right. Now that we've set up a project in Google, we're free to start implementing Google OAuth into our app. Now, as we learned, the first step in the OAuth flow is to have Google generate a special URL for us to send the user to so that they can tell Google if it's okay for us to access their data. So the first thing we're going to do here is create a route on our server that will generate this URL and send it back to our client. So here's what that's going to look like. We're going to open up routes and create a new file here which we'll call get Google OAuth URL route, kind of a cumbersome name, but it'll work. And we could just put all of the logic for generating this URL directly into the route itself, but what we're actually going to do before we code out this route is create a utility function. So inside Util we'll create a new file and we're going to call this file, Get Google Oauth URL.JS. So…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
(已锁定)
OAuth basics3 分钟 17 秒
-
(已锁定)
Setting up OAuth on Google6 分钟 33 秒
-
(已锁定)
Adding an OAuth URL route7 分钟 49 秒
-
(已锁定)
Creating a "Sign in with Google" button4 分钟 49 秒
-
(已锁定)
Loading user info from Google5 分钟 32 秒
-
(已锁定)
Creating new users from OAuth data4 分钟 32 秒
-
(已锁定)
Adding an OAuth callback route4 分钟 26 秒
-
(已锁定)
Handling successful OAuth authentication3 分钟 40 秒
-
(已锁定)
-
-
-