Skip to content

Commit 89d7232

Browse files
authored
Merge pull request #91 from privy-open-source/release/0.6.0
chore: bump version to `0.6.0`
2 parents 9bc58be + d905267 commit 89d7232

File tree

6 files changed

+641
-92
lines changed

6 files changed

+641
-92
lines changed

.yarn/plugins/@yarnpkg/plugin-version.cjs

Lines changed: 550 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/versions/a69dd823.yml

Whitespace-only changes.

.yarnrc.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
yarnPath: .yarn/releases/yarn-3.6.1.cjs
21
nodeLinker: node-modules
2+
3+
plugins:
4+
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
5+
spec: "@yarnpkg/plugin-version"
6+
7+
yarnPath: .yarn/releases/yarn-3.6.1.cjs

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ This module read enviroment variables directly.
7070
| OAUTH_HOST | - | **(Required)** Oauth server's host |
7171
| OAUTH_CLIENT_ID | - | **(Required)** Oauth Client ID |
7272
| OAUTH_CLIENT_SECRET | - | **(Required)** Oauth Client Secret |
73-
| OAUTH_REDIRECT_URI | `/auth/callback` | Oauth Callback URI |
73+
| OAUTH_REDIRECT_URI | `/auth/callback` | Oauth Callback URI |
7474
| OAUTH_SCOPE | `public read` | Oauth scope |
7575
| OAUTH_LOGOUT_URI | - | Oauth Logout URI |
7676
| OAUTH_HOME | `/` | Redirect path after success login |
@@ -148,7 +148,7 @@ const {
148148

149149
## Disable redirection page
150150

151-
To prevent displaying the redirection page, you can set the sameSite attribute of the cookie to `lax` or `none`.
151+
To prevent displaying the redirection page, you can set the sameSite attribute of the cookie to `lax` or `none`.
152152

153153
```js
154154
export default defineNuxtConfig({

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@privyid/nuauth",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"packageManager": "yarn@3.6.1",
55
"license": "MIT",
66
"type": "module",

src/core/redirect.ts

Lines changed: 82 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -17,104 +17,98 @@ export default async function getRedirectPage (
1717
cookieConfig: CookieSerializeOptions,
1818
): Promise<void> {
1919
const isCookieStrict = cookieConfig.sameSite === 'strict' || cookieConfig.sameSite === true
20-
21-
const isIframe = getHeader(event, 'sec-fetch-dest') === 'iframe'
20+
const isIframe = getHeader(event, 'sec-fetch-dest') === 'iframe'
2221

2322
if (isCookieStrict || isIframe) {
2423
// Use meta refresh as redirection to fix issue with cookies samesite=strict
2524
// See: https://stackoverflow.com/questions/42216700/how-can-i-redirect-after-oauth2-with-samesite-strict-and-still-get-my-cookies
2625
// Live demo: https://codepen.io/adenvt/pen/gOQjgyM
27-
await send(
28-
event,
29-
`
30-
<!DOCTYPE html>
31-
<html lang="en">
32-
<head>
33-
<meta charset="UTF-8">
34-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
35-
<meta http-equiv="refresh" content="0;URL='${url}'" />
36-
37-
<title>Processing...</title>
38-
39-
<link rel="preconnect" href="https://fonts.googleapis.com">
40-
<link rel="preconnect" href="https://fonts.gstatic.com">
41-
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;1,400&display=swap">
42-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/normalize.css@8.0.1/normalize.min.css">
43-
44-
<style>
45-
@keyframes progressbar {
46-
0% {
47-
transform: translateX(-75%);
26+
await send(event, `
27+
<!DOCTYPE html>
28+
<html lang="en">
29+
<head>
30+
<meta charset="UTF-8">
31+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
32+
<meta http-equiv="refresh" content="0;URL='${url}'" />
33+
34+
<title>Processing...</title>
35+
36+
<link rel="preconnect" href="https://fonts.googleapis.com">
37+
<link rel="preconnect" href="https://fonts.gstatic.com">
38+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;1,400&display=swap">
39+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/normalize.css@8.0.1/normalize.min.css">
40+
41+
<style>
42+
@keyframes progressbar {
43+
0% {
44+
transform: translateX(-75%);
45+
}
46+
47+
100% {
48+
transform: translateX(225%);
49+
}
50+
}
51+
52+
:root {
53+
font-family: 'DM Sans', sans-serif;
54+
color: #0D1117;
55+
}
56+
57+
.container {
58+
display: flex;
59+
align-items: center;
60+
justify-content: center;
61+
min-height: 100vh;
62+
}
63+
64+
.loading {
65+
width: 100%;
66+
border-radius: 9999px;
67+
height: 4px;
68+
background: #F3F3F3;
69+
overflow: hidden;
70+
isolation: isolate;
71+
}
72+
73+
.loading__bar {
74+
border-radius: 9999px;
75+
height: 100%;
76+
width: 40%;
77+
background: #0065D1;
78+
animation: progressbar 1s alternate ease-in-out infinite;
79+
}
80+
81+
h1 {
82+
font-size: 2rem;
83+
line-height: 1.67;
84+
margin-top: 0;
85+
margin-bottom: .5rem;
86+
}
87+
88+
a {
89+
color: #0057B4;
4890
}
4991
50-
100% {
51-
transform: translateX(225%);
92+
body {
93+
background-color: #FDFDFD;
5294
}
53-
}
54-
55-
:root {
56-
font-family: 'DM Sans', sans-serif;
57-
color: #0D1117;
58-
}
59-
60-
.container {
61-
display: flex;
62-
align-items: center;
63-
justify-content: center;
64-
min-height: 100vh;
65-
}
66-
67-
.loading {
68-
width: 100%;
69-
border-radius: 9999px;
70-
height: 4px;
71-
background: #F3F3F3;
72-
overflow: hidden;
73-
isolation: isolate;
74-
}
75-
76-
.loading__bar {
77-
border-radius: 9999px;
78-
height: 100%;
79-
width: 40%;
80-
background: #0065D1;
81-
animation: progressbar 1s alternate ease-in-out infinite;
82-
}
83-
84-
h1 {
85-
font-size: 2rem;
86-
line-height: 1.67;
87-
margin-top: 0;
88-
margin-bottom: .5rem;
89-
}
90-
91-
a {
92-
color: #0057B4;
93-
}
94-
95-
body {
96-
background-color: #FDFDFD;
97-
}
98-
</style>
99-
</head>
100-
101-
<body>
102-
<div class="container">
103-
<div>
104-
<h1>
105-
Processing...
106-
</h1>
107-
<div class="loading">
108-
<div class="loading__bar"></div>
95+
</style>
96+
</head>
97+
98+
<body>
99+
<div class="container">
100+
<div>
101+
<h1>
102+
Processing...
103+
</h1>
104+
<div class="loading">
105+
<div class="loading__bar"></div>
106+
</div>
107+
<p>Please wait a while. If you are not redirect automatically, <a href="${url}">click here</a>.</p>
109108
</div>
110-
<p>Please wait a while. If you are not redirect automatically, <a href="${url}">click here</a>.</p>
111109
</div>
112-
</div>
113-
</body>
114-
</html>
115-
`,
116-
'text/html',
117-
)
110+
</body>
111+
</html>`, 'text/html')
118112

119113
return
120114
}

0 commit comments

Comments
 (0)