@@ -17,104 +17,98 @@ export default async function getRedirectPage (
17
17
cookieConfig : CookieSerializeOptions ,
18
18
) : Promise < void > {
19
19
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'
22
21
23
22
if ( isCookieStrict || isIframe ) {
24
23
// Use meta refresh as redirection to fix issue with cookies samesite=strict
25
24
// See: https://stackoverflow.com/questions/42216700/how-can-i-redirect-after-oauth2-with-samesite-strict-and-still-get-my-cookies
26
25
// 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;
48
90
}
49
91
50
- 100% {
51
- transform: translateX(225%) ;
92
+ body {
93
+ background-color: #FDFDFD ;
52
94
}
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>
109
108
</div>
110
- <p>Please wait a while. If you are not redirect automatically, <a href="${ url } ">click here</a>.</p>
111
109
</div>
112
- </div>
113
- </body>
114
- </html>
115
- ` ,
116
- 'text/html' ,
117
- )
110
+ </body>
111
+ </html>` , 'text/html' )
118
112
119
113
return
120
114
}
0 commit comments