Skip to content

Commit

Permalink
testing social login
Browse files Browse the repository at this point in the history
  • Loading branch information
Roger Calaf authored and Roger Calaf committed Dec 6, 2024
1 parent 8bd3096 commit 272d384
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions controllers/authController.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const jwtSingIn = async (user) => {

const handleGoogleLogin = async (req, res) => {
console.log("Goolge Login.")
console.log(req.body);
// console.log(req.body);
const platform = req.body.platform;
const token = req.body.tokenId;

Expand Down Expand Up @@ -199,15 +199,14 @@ const handleGoogleLogin = async (req, res) => {

const handleAppleLogin = async (req, res) => {
console.log("Apple Login.")
//console.log(req.body);
console.log(req.body);
const token = req.body.tokenId;
const platform = req.body.platform;
const userDetails = req.body.user;
//console.log( process.env.GOOGLE_IOS_CLIENT_ID)
let isNewUser = false;
try{
// console.log(jwtDecode(token))
console.log(req.body);
// console.log(jwtDecode(token));
const {email, sub } = jwtDecode(token);
let user = await User.findOne({$and: [{appleUserId: sub },{email: email.toLowerCase() }]}).exec();
if (!user) {
Expand Down

0 comments on commit 272d384

Please sign in to comment.