@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.js CHANGED
@@ -79,7 +79,7 @@ var X_NILE_SECURECOOKIES = "nile.secure_cookies";
79
79
 
80
80
  // src/api/utils/request.ts
81
81
  async function request(url, _init, config) {
82
- const { info, error } = Logger(config, "[REQUEST]");
82
+ const { debug, info, error } = Logger(config, "[REQUEST]");
83
83
  const { request: request2, ...init } = _init;
84
84
  const requestUrl = new URL(request2.url);
85
85
  const updatedHeaders = new Headers({});
@@ -103,6 +103,7 @@ async function request(url, _init, config) {
103
103
  } else {
104
104
  updatedHeaders.set(X_NILE_ORIGIN, requestUrl.origin);
105
105
  }
106
+ debug(`Using origin ${updatedHeaders.get(X_NILE_ORIGIN)}`);
106
107
  const params = { ...init, headers: updatedHeaders };
107
108
  if (params.method === "POST" || params.method === "PUT") {
108
109
  try {
@@ -1653,8 +1654,16 @@ function POSTER(configRoutes, config) {
1653
1654
  const { info, warn, error } = Logger(config, "[POST MATCHER]");
1654
1655
  return async function POST5(req) {
1655
1656
  if (matchesLog(configRoutes, req)) {
1656
- error(req.body && await req.json());
1657
- return new Response(null, { status: 200 });
1657
+ if (req.body) {
1658
+ try {
1659
+ const text = await req.text();
1660
+ error(text);
1661
+ return new Response(null, {
1662
+ status: 200
1663
+ });
1664
+ } catch (e) {
1665
+ }
1666
+ }
1658
1667
  }
1659
1668
  if (matches3(configRoutes, req)) {
1660
1669
  info("matches tenant users");
@@ -2378,7 +2387,7 @@ var Api = class {
2378
2387
  this.routes.USERS,
2379
2388
  this.routes.TENANTS,
2380
2389
  this.routes.SESSION,
2381
- this.routes.SIGNIN,
2390
+ `${this.routes.SIGNIN}/{provider}`,
2382
2391
  this.routes.PASSWORD_RESET,
2383
2392
  this.routes.PROVIDERS,
2384
2393
  this.routes.CSRF,