今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Creating new users from OAuth data
- [Instructor] All right. So now that we've implemented our get Google user, helper function, we're going to go over and implement our update, or create user from Oauth helper function. And what this function is going to do is basically, it will take the information we get back from Google Oauth and create a new user in our database, from that data, unless we already have a user with that email, in which case it will simply update their profile with that data. Okay, so it'll basically merge their existing profile, with their username and password, with their Google Oauth data that we get back. So here's what this function is going to look like. We're going to say import, get db connection, from db. We're going to say export const, update or create user from Oauth. This is going to be an async function. And it's going to take, the Oauth user info, that we got back from Google, from our previous get Google user…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
(已锁定)
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 秒
-
(已锁定)
-
-
-