@niledatabase/server 4.0.0-alpha.16 → 4.0.0-alpha.18

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/dist/index.mjs CHANGED
@@ -73,7 +73,7 @@ var X_NILE_SECURECOOKIES = "nile.secure_cookies";
73
73
 
74
74
  // src/api/utils/request.ts
75
75
  async function request(url, _init, config) {
76
- const { info, error } = Logger(config, "[REQUEST]");
76
+ const { debug, info, error } = Logger(config, "[REQUEST]");
77
77
  const { request: request2, ...init } = _init;
78
78
  const requestUrl = new URL(request2.url);
79
79
  const updatedHeaders = new Headers({});
@@ -97,6 +97,7 @@ async function request(url, _init, config) {
97
97
  } else {
98
98
  updatedHeaders.set(X_NILE_ORIGIN, requestUrl.origin);
99
99
  }
100
+ debug(`Using origin ${updatedHeaders.get(X_NILE_ORIGIN)}`);
100
101
  const params = { ...init, headers: updatedHeaders };
101
102
  if (params.method === "POST" || params.method === "PUT") {
102
103
  try {
@@ -1647,8 +1648,16 @@ function POSTER(configRoutes, config) {
1647
1648
  const { info, warn, error } = Logger(config, "[POST MATCHER]");
1648
1649
  return async function POST5(req) {
1649
1650
  if (matchesLog(configRoutes, req)) {
1650
- error(req.body && await req.json());
1651
- return new Response(null, { status: 200 });
1651
+ if (req.body) {
1652
+ try {
1653
+ const text = await req.text();
1654
+ error(text);
1655
+ return new Response(null, {
1656
+ status: 200
1657
+ });
1658
+ } catch (e) {
1659
+ }
1660
+ }
1652
1661
  }
1653
1662
  if (matches3(configRoutes, req)) {
1654
1663
  info("matches tenant users");
@@ -2372,7 +2381,7 @@ var Api = class {
2372
2381
  this.routes.USERS,
2373
2382
  this.routes.TENANTS,
2374
2383
  this.routes.SESSION,
2375
- this.routes.SIGNIN,
2384
+ `${this.routes.SIGNIN}/{provider}`,
2376
2385
  this.routes.PASSWORD_RESET,
2377
2386
  this.routes.PROVIDERS,
2378
2387
  this.routes.CSRF,