@server/next 0.47.0 → 0.47.1

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.
Files changed (2) hide show
  1. package/index.js +24 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1251,12 +1251,12 @@ var CLASSES = {
1251
1251
  yahoo: Yahoo,
1252
1252
  yandex: Yandex,
1253
1253
  zoom: Zoom,
1254
- 42: FortyTwo
1254
+ fortytwo: FortyTwo
1255
1255
  };
1256
1256
  var ALIASES = {
1257
- microsoft: "microsoftentraid",
1258
1257
  cognito: "amazoncognito",
1259
- entra: "microsoftentraid"
1258
+ entra: "microsoftentraid",
1259
+ microsoft: "microsoftentraid"
1260
1260
  };
1261
1261
  var providers = Object.fromEntries(
1262
1262
  Object.entries(CLASSES).map(([name, Client]) => [
@@ -1265,7 +1265,7 @@ var providers = Object.fromEntries(
1265
1265
  ])
1266
1266
  );
1267
1267
  for (const [alias, target2] of Object.entries(ALIASES)) {
1268
- providers[alias] = providers[target2];
1268
+ providers[alias] = antarcticProvider(alias, CLASSES[target2]);
1269
1269
  }
1270
1270
  var ISSUERS = {
1271
1271
  paypal: "https://www.paypal.com"
@@ -1421,6 +1421,12 @@ function entry(config2) {
1421
1421
  );
1422
1422
  }
1423
1423
  }
1424
+ const publicProfile = ({ id, email, name, avatar }) => ({
1425
+ id,
1426
+ email,
1427
+ name,
1428
+ avatar
1429
+ });
1424
1430
  const redirects = typeof config2.redirect === "object" ? config2.redirect : {};
1425
1431
  const loginTo = typeof config2.redirect === "object" ? redirects.login : config2.redirect;
1426
1432
  const finish = async (ctx, profile) => {
@@ -1432,7 +1438,7 @@ function entry(config2) {
1432
1438
  if (!isSigned(strategies[0])) return { sub: String(id) };
1433
1439
  const user2 = await getUser(String(id), ctx);
1434
1440
  return { user: await toPublicUser(user2) };
1435
- })() : { user: profile };
1441
+ })() : { user: publicProfile(profile) };
1436
1442
  const signed = { ...payload, provider: profile.provider };
1437
1443
  const token = await issue(ctx, signed, expires);
1438
1444
  const user = signed.user ?? await getUser(signed.sub, ctx);
@@ -1639,6 +1645,19 @@ var VENDORS = {
1639
1645
  claim: "azp",
1640
1646
  docs: "https://clerk.com/docs/backend-requests/resources/session-tokens"
1641
1647
  },
1648
+ firebase: {
1649
+ // The client SDK holds the token and sends it as a header, so no cookie.
1650
+ // Both halves are the project id: the issuer is per-project, and it is
1651
+ // what Firebase puts in `aud`.
1652
+ audience: "your Firebase project id",
1653
+ docs: "https://firebase.google.com/docs/auth/admin/verify-id-tokens"
1654
+ },
1655
+ // Google Cloud Identity Platform is the same service, and the same tokens,
1656
+ // under its enterprise name
1657
+ gcip: {
1658
+ audience: "your Google Cloud project id",
1659
+ docs: "https://cloud.google.com/identity-platform/docs/how-to-verify-tokens"
1660
+ },
1642
1661
  supabase: {
1643
1662
  audience: '"authenticated"',
1644
1663
  docs: "https://supabase.com/docs/guides/auth/jwts"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@server/next",
3
- "version": "0.47.0",
3
+ "version": "0.47.1",
4
4
  "description": "A fully-fledged web server with routing, file uploads, sessions, static files, schema validation, websockets, testing, etc.",
5
5
  "homepage": "https://server-js.com/",
6
6
  "repository": "github:franciscop/server-next",