无法获取用户个人资料抽搐护照

时间:2021-02-25 09:30:14

标签: javascript node.js

twitch 和我也使用 google-passport,但通过 google 没有遇到这个问题,我的数据保存正确

这里我遵循护照图书馆提供的相同文件 我正在使用护照抽搐 ClientId 正在从 twitch 开发者控制台使用

passport.use(new TwitchStrategy.Strategy({
    clientID: Social.auth_config.TWITCH_AUTH_CLIENTID,
    clientSecret: Social.auth_config.TWITCH_AUTH_SECRETID,
    callbackURL: "https://9bf5e1cd27be.ngrok.io/api/auth/twitch/redirect",
    scope: "user_read"
  },
  (token, tokenSecret, profile, done) => {
            Auth_User.findOne({where:{ socialId: profile.id }}).then(user => {
                if (user) {
                    console.log('Current User is', user, {
                        userName: profile.displayName,
                        socialId: profile.id,
                        
                    });
                    done(null, user);
                } else {
                    let createUser=  Auth_User.create({
                      userName: profile.displayName,
                        socialId: profile.id,
                        
                    })
                    
                    createUser.then(savedUser => {
                        done(null, savedUser);
                    });
                }
            });
        }
));

0 个答案:

没有答案
相关问题