signinwith 1.0.5 → 1.0.7
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/readme.md +6 -1
package/index.js
CHANGED
|
@@ -34,10 +34,10 @@ export const verifySigninDiscord = async (config, verificationData) => {
|
|
|
34
34
|
return profile.email ? { success: true, email: profile.email } : { success: false, error: 'Email not available from Discord' };
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
export default
|
|
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.
|
|
40
|
+
if (services.facebook && service === 'facebook') return await verifySigninMeta(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
package/readme.md
CHANGED
|
@@ -247,4 +247,9 @@ For Discord and Apple, the `redirectUri` in the frontend configuration should po
|
|
|
247
247
|
</html>
|
|
248
248
|
```
|
|
249
249
|
|
|
250
|
-
This HTML file extracts the authorization code (or error) from the URL hash and sends it back to the main window using `postMessage`. The main application needs to listen for this message and then proceed with the backend verification. This approach is necessary because Discord's OAuth flow, when initiated in a popup, requires a way to pass the authorization code back to the originating window.
|
|
250
|
+
This HTML file extracts the authorization code (or error) from the URL hash and sends it back to the main window using `postMessage`. The main application needs to listen for this message and then proceed with the backend verification. This approach is necessary because Discord's OAuth flow, when initiated in a popup, requires a way to pass the authorization code back to the originating window.
|
|
251
|
+
|
|
252
|
+
Note: you can import this page as a string (to then return it as a response from your server) via:
|
|
253
|
+
```javascript
|
|
254
|
+
import htmlContent from 'signinwith/redirect-oauth.html?raw';
|
|
255
|
+
```
|