signinwith 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export const verifySigninGoogle = async (config, verificationData) => {
|
|
|
5
5
|
return payload.email ? { success: true, email: payload.email } : { success: false, error: 'Email not found' };
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
export const
|
|
8
|
+
export const verifySigninFacebook = async (config, verificationData) => {
|
|
9
9
|
const res = await fetch(`https://graph.facebook.com/me?fields=email&access_token=${verificationData.accessToken}`);
|
|
10
10
|
const profile = await res.json();
|
|
11
11
|
return profile.email ? { success: true, email: profile.email } : { success: false, error: 'Email not available from Facebook' };
|
|
@@ -37,7 +37,7 @@ export const verifySigninDiscord = async (config, verificationData) => {
|
|
|
37
37
|
export default async function verifySignin (services, service, verificationData) {
|
|
38
38
|
try {
|
|
39
39
|
if (services.google && service === 'google') return await verifySigninGoogle(services.google, verificationData);
|
|
40
|
-
if (services.facebook && service === 'facebook') return await
|
|
40
|
+
if (services.facebook && service === 'facebook') return await verifySigninFacebook(services.facebook, verificationData);
|
|
41
41
|
if (services.apple && service === 'apple') return await verifySigninApple(services.apple, verificationData);
|
|
42
42
|
if (services.discord && service === 'discord') return await verifySigninDiscord(services.discord, verificationData);
|
|
43
43
|
return { success: false, error: 'Unsupported service' };
|
package/package.json
CHANGED