fastify-txstate 3.6.8 → 3.6.9

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.
@@ -196,9 +196,17 @@ function registerUaCookieRoutes(app) {
196
196
  const redirectUrl = req.auth?.issuerConfig?.logoutUrl && (0, txstate_utils_1.isNotBlank)(req.auth.token)
197
197
  ? `${req.auth.issuerConfig.logoutUrl.toString()}?unifiedJwt=${encodeURIComponent(req.auth.token)}`
198
198
  : (process.env.PUBLIC_URL || new URL('..', req.url).toString());
199
- return res
200
- .header('Set-Cookie', `${uaCookieName}=; Path=/; Secure; HttpOnly; SameSite=Lax; Expires=Thu, 01 Jan 1970 00:00:00 GMT`)
201
- .redirect(redirectUrl);
199
+ void res.header('Set-Cookie', `${uaCookieName}=; Path=/; Secure; HttpOnly; SameSite=Lax; Expires=Thu, 01 Jan 1970 00:00:00 GMT`);
200
+ return `<!DOCTYPE html>
201
+ <html lang="en">
202
+ <head>
203
+ <meta charset="UTF-8">
204
+ <meta http-equiv="refresh" content="0; url=${(0, txstate_utils_1.htmlEncode)(redirectUrl)}">
205
+ <title>Logging out...</title>
206
+ </head>
207
+ <body>
208
+ </body>
209
+ </html>`;
202
210
  });
203
211
  app.get('/.uaService', {
204
212
  schema: {
@@ -213,9 +221,18 @@ function registerUaCookieRoutes(app) {
213
221
  }
214
222
  }
215
223
  }, async (req, res) => {
216
- return res
217
- .header('Set-Cookie', `${uaCookieName}=${req.query.unifiedJwt}; Path=/; Secure; HttpOnly; SameSite=Lax`)
218
- .redirect(req.query.requestedUrl ?? (process.env.PUBLIC_URL || new URL('..', req.url).toString()));
224
+ void res.header('Set-Cookie', `${uaCookieName}=${req.query.unifiedJwt}; Path=/; Secure; HttpOnly; SameSite=Lax`);
225
+ void res.type('text/html');
226
+ return `<!DOCTYPE html>
227
+ <html lang="en">
228
+ <head>
229
+ <meta charset="UTF-8">
230
+ <meta http-equiv="refresh" content="0; url=${(0, txstate_utils_1.htmlEncode)(req.query.requestedUrl ?? (process.env.PUBLIC_URL || new URL('..', req.url).toString()))}">
231
+ <title>Logging in...</title>
232
+ </head>
233
+ <body>
234
+ </body>
235
+ </html>`;
219
236
  });
220
237
  /**
221
238
  * In the case of a client-side application that uses the UA cookie to authenticate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastify-txstate",
3
- "version": "3.6.8",
3
+ "version": "3.6.9",
4
4
  "description": "A small wrapper for fastify providing a set of common conventions & utility functions we use.",
5
5
  "exports": {
6
6
  ".": {