signinwith 1.0.3 → 1.0.5
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/package.json +3 -2
- package/redirect-oauth.html +45 -0
- package/styles.css +13 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signinwith",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Simple and straightforward library for sign in / sign up with thirdparty oAuth services like Google, Meta, Apple, Discord...",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": "./index.js",
|
|
11
11
|
"./react": "./react.jsx",
|
|
12
|
-
"./styles.css": "./styles.css"
|
|
12
|
+
"./styles.css": "./styles.css",
|
|
13
|
+
"./redirect-oauth.html": "./redirect-oauth.html"
|
|
13
14
|
},
|
|
14
15
|
"keywords": [
|
|
15
16
|
"signinwith",
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Discord Authentication</title>
|
|
5
|
+
<style>
|
|
6
|
+
body {
|
|
7
|
+
font-family: sans-serif;
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
height: 100vh;
|
|
12
|
+
margin: 0;
|
|
13
|
+
background-color: #f0f0f0;
|
|
14
|
+
}
|
|
15
|
+
.container {
|
|
16
|
+
text-align: center;
|
|
17
|
+
padding: 20px;
|
|
18
|
+
background-color: #fff;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
</head>
|
|
24
|
+
<body>
|
|
25
|
+
<div class="container">
|
|
26
|
+
<p>You can close this window now.</p>
|
|
27
|
+
<script>
|
|
28
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
29
|
+
const code = urlParams.get('code');
|
|
30
|
+
const error = urlParams.get('error');
|
|
31
|
+
|
|
32
|
+
if (code) {
|
|
33
|
+
window.opener.postMessage({ type: 'discordAuth', code: code }, window.location.origin);
|
|
34
|
+
} else if(error) {
|
|
35
|
+
window.opener.postMessage({ type: 'oauthError', error: error }, window.location.origin);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Attempt to close the window
|
|
39
|
+
setTimeout(() => {
|
|
40
|
+
window.close();
|
|
41
|
+
}, 0);
|
|
42
|
+
</script>
|
|
43
|
+
</div>
|
|
44
|
+
</body>
|
|
45
|
+
</html>
|
package/styles.css
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
text-decoration: none;
|
|
19
19
|
align-self: stretch;
|
|
20
20
|
box-sizing: border-box;
|
|
21
|
-
transition:
|
|
21
|
+
transition: opacity 0.3s ease;
|
|
22
22
|
color: #3c4043;
|
|
23
23
|
background-color: #ffffff;
|
|
24
24
|
|
|
@@ -30,10 +30,11 @@
|
|
|
30
30
|
|
|
31
31
|
&:hover {
|
|
32
32
|
background-color: #f8f9fa;
|
|
33
|
+
opacity:0.9;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
&.signinwith-button-facebook {
|
|
36
|
-
background-color: #
|
|
37
|
+
background-color: #0866ff;
|
|
37
38
|
color: white;
|
|
38
39
|
border-color: #0866ff;
|
|
39
40
|
|
|
@@ -41,6 +42,16 @@
|
|
|
41
42
|
background-color: #0866ff;
|
|
42
43
|
}
|
|
43
44
|
}
|
|
45
|
+
|
|
46
|
+
&.signinwith-button-discord {
|
|
47
|
+
background-color: #5d67f7;
|
|
48
|
+
color: white;
|
|
49
|
+
border-color: #5d67f7;
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
background-color: #5d67f7;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
44
55
|
|
|
45
56
|
&.signinwith-button-apple {
|
|
46
57
|
background-color: #000000;
|