@niledatabase/server 3.0.0-alpha.40 → 3.0.0-alpha.42

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.
@@ -1432,7 +1432,7 @@ function _request() {
1432
1432
  return _request.apply(this, arguments);
1433
1433
  }
1434
1434
 
1435
- var key$9 = 'ME';
1435
+ var key$a = 'ME';
1436
1436
  /**
1437
1437
  * @swagger
1438
1438
  * /api/me:
@@ -1483,16 +1483,16 @@ function _GET$4() {
1483
1483
  }));
1484
1484
  return _GET$4.apply(this, arguments);
1485
1485
  }
1486
- function route$c(_x4, _x5) {
1487
- return _route$c.apply(this, arguments);
1486
+ function route$d(_x4, _x5) {
1487
+ return _route$d.apply(this, arguments);
1488
1488
  }
1489
- function _route$c() {
1490
- _route$c = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request, config) {
1489
+ function _route$d() {
1490
+ _route$d = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request, config) {
1491
1491
  var url;
1492
1492
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1493
1493
  while (1) switch (_context2.prev = _context2.next) {
1494
1494
  case 0:
1495
- url = apiRoutes(config)[key$9];
1495
+ url = apiRoutes(config)[key$a];
1496
1496
  _context2.t0 = request.method;
1497
1497
  _context2.next = _context2.t0 === 'GET' ? 4 : 7;
1498
1498
  break;
@@ -1513,10 +1513,10 @@ function _route$c() {
1513
1513
  }
1514
1514
  }, _callee2);
1515
1515
  }));
1516
- return _route$c.apply(this, arguments);
1516
+ return _route$d.apply(this, arguments);
1517
1517
  }
1518
- function matches$c(configRoutes, request) {
1519
- return urlMatches(request.url, configRoutes[key$9]);
1518
+ function matches$d(configRoutes, request) {
1519
+ return urlMatches(request.url, configRoutes[key$a]);
1520
1520
  }
1521
1521
 
1522
1522
  function auth(_x, _x2) {
@@ -2065,19 +2065,19 @@ function _PUT$2() {
2065
2065
  return _PUT$2.apply(this, arguments);
2066
2066
  }
2067
2067
 
2068
- var key$8 = 'USERS';
2069
- function route$b(_x, _x2) {
2070
- return _route$b.apply(this, arguments);
2068
+ var key$9 = 'USERS';
2069
+ function route$c(_x, _x2) {
2070
+ return _route$c.apply(this, arguments);
2071
2071
  }
2072
- function _route$b() {
2073
- _route$b = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request, config) {
2072
+ function _route$c() {
2073
+ _route$c = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request, config) {
2074
2074
  var _Logger, info, session;
2075
2075
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2076
2076
  while (1) switch (_context.prev = _context.next) {
2077
2077
  case 0:
2078
2078
  _Logger = Logger(_extends({}, config, {
2079
2079
  debug: config.debug
2080
- }), "[ROUTES][" + key$8 + "]"), info = _Logger.info;
2080
+ }), "[ROUTES][" + key$9 + "]"), info = _Logger.info;
2081
2081
  _context.next = 3;
2082
2082
  return auth(request, config);
2083
2083
  case 3:
@@ -2116,10 +2116,10 @@ function _route$b() {
2116
2116
  }
2117
2117
  }, _callee);
2118
2118
  }));
2119
- return _route$b.apply(this, arguments);
2119
+ return _route$c.apply(this, arguments);
2120
2120
  }
2121
- function matches$b(configRoutes, request) {
2122
- return urlMatches(request.url, configRoutes[key$8]);
2121
+ function matches$c(configRoutes, request) {
2122
+ return urlMatches(request.url, configRoutes[key$9]);
2123
2123
  }
2124
2124
 
2125
2125
  /**
@@ -2354,19 +2354,19 @@ function _PUT$1() {
2354
2354
  return _PUT$1.apply(this, arguments);
2355
2355
  }
2356
2356
 
2357
- var key$7 = 'TENANT_USERS';
2358
- function route$a(_x, _x2) {
2359
- return _route$a.apply(this, arguments);
2357
+ var key$8 = 'TENANT_USERS';
2358
+ function route$b(_x, _x2) {
2359
+ return _route$b.apply(this, arguments);
2360
2360
  }
2361
- function _route$a() {
2362
- _route$a = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request, config) {
2361
+ function _route$b() {
2362
+ _route$b = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request, config) {
2363
2363
  var _Logger, info, session, yurl, _yurl$pathname$split$, tenantId;
2364
2364
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2365
2365
  while (1) switch (_context.prev = _context.next) {
2366
2366
  case 0:
2367
2367
  _Logger = Logger(_extends({}, config, {
2368
2368
  debug: config.debug
2369
- }), "[ROUTES][" + key$7 + "]"), info = _Logger.info;
2369
+ }), "[ROUTES][" + key$8 + "]"), info = _Logger.info;
2370
2370
  _context.next = 3;
2371
2371
  return auth(request, config);
2372
2372
  case 3:
@@ -2432,17 +2432,17 @@ function _route$a() {
2432
2432
  }
2433
2433
  }, _callee);
2434
2434
  }));
2435
- return _route$a.apply(this, arguments);
2435
+ return _route$b.apply(this, arguments);
2436
2436
  }
2437
- function matches$a(configRoutes, request) {
2437
+ function matches$b(configRoutes, request) {
2438
2438
  var url = new URL(request.url);
2439
2439
  var _url$pathname$split$r = url.pathname.split('/').reverse(),
2440
2440
  userId = _url$pathname$split$r[0],
2441
2441
  possibleTenantId = _url$pathname$split$r[1],
2442
2442
  tenantId = _url$pathname$split$r[2];
2443
- var route = configRoutes[key$7].replace('{tenantId}', tenantId).replace('{userId}', userId);
2443
+ var route = configRoutes[key$8].replace('{tenantId}', tenantId).replace('{userId}', userId);
2444
2444
  if (userId === 'users') {
2445
- route = configRoutes[key$7].replace('{tenantId}', possibleTenantId);
2445
+ route = configRoutes[key$8].replace('{tenantId}', possibleTenantId);
2446
2446
  }
2447
2447
  return urlMatches(request.url, route);
2448
2448
  }
@@ -2777,19 +2777,19 @@ function isUUID(value) {
2777
2777
  var regex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5|7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
2778
2778
  return regex.test(value);
2779
2779
  }
2780
- var key$6 = 'TENANTS';
2781
- function route$9(_x, _x2) {
2782
- return _route$9.apply(this, arguments);
2780
+ var key$7 = 'TENANTS';
2781
+ function route$a(_x, _x2) {
2782
+ return _route$a.apply(this, arguments);
2783
2783
  }
2784
- function _route$9() {
2785
- _route$9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request, config) {
2784
+ function _route$a() {
2785
+ _route$a = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request, config) {
2786
2786
  var _Logger, info, session, _request$url$split$re, possibleTenantId;
2787
2787
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2788
2788
  while (1) switch (_context.prev = _context.next) {
2789
2789
  case 0:
2790
2790
  _Logger = Logger(_extends({}, config, {
2791
2791
  debug: config.debug
2792
- }), "[ROUTES][" + key$6 + "]"), info = _Logger.info;
2792
+ }), "[ROUTES][" + key$7 + "]"), info = _Logger.info;
2793
2793
  _context.next = 3;
2794
2794
  return auth(request, config);
2795
2795
  case 3:
@@ -2856,10 +2856,10 @@ function _route$9() {
2856
2856
  }
2857
2857
  }, _callee);
2858
2858
  }));
2859
- return _route$9.apply(this, arguments);
2859
+ return _route$a.apply(this, arguments);
2860
2860
  }
2861
- function matches$9(configRoutes, request) {
2862
- return urlMatches(request.url, configRoutes[key$6]);
2861
+ function matches$a(configRoutes, request) {
2862
+ return urlMatches(request.url, configRoutes[key$7]);
2863
2863
  }
2864
2864
 
2865
2865
  var proxyRoutes = function proxyRoutes(config) {
@@ -2871,21 +2871,22 @@ var proxyRoutes = function proxyRoutes(config) {
2871
2871
  CALLBACK: makeRestUrl(config, '/auth/callback'),
2872
2872
  SIGNOUT: makeRestUrl(config, '/auth/signout'),
2873
2873
  ERROR: makeRestUrl(config, '/auth/error'),
2874
- VERIFY_REQUEST: makeRestUrl(config, '/auth/verify-request')
2874
+ VERIFY_REQUEST: makeRestUrl(config, '/auth/verify-request'),
2875
+ PASSWORD_RESET: makeRestUrl(config, '/auth/reset-password')
2875
2876
  };
2876
2877
  };
2877
2878
 
2878
- var key$5 = 'SIGNIN';
2879
- function route$8(_x, _x2) {
2880
- return _route$8.apply(this, arguments);
2879
+ var key$6 = 'SIGNIN';
2880
+ function route$9(_x, _x2) {
2881
+ return _route$9.apply(this, arguments);
2881
2882
  }
2882
- function _route$8() {
2883
- _route$8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
2883
+ function _route$9() {
2884
+ _route$9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
2884
2885
  var url, init, _URL$pathname$split$r, provider, passThroughUrl, params, res;
2885
2886
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2886
2887
  while (1) switch (_context.prev = _context.next) {
2887
2888
  case 0:
2888
- url = proxyRoutes(config)[key$5];
2889
+ url = proxyRoutes(config)[key$6];
2889
2890
  init = {
2890
2891
  method: req.method,
2891
2892
  headers: req.headers
@@ -2895,7 +2896,7 @@ function _route$8() {
2895
2896
  init.body = req.clone().body;
2896
2897
  }
2897
2898
  _URL$pathname$split$r = new URL(req.url).pathname.split('/').reverse(), provider = _URL$pathname$split$r[0];
2898
- url = proxyRoutes(config)[key$5] + "/" + provider;
2899
+ url = proxyRoutes(config)[key$6] + "/" + provider;
2899
2900
  }
2900
2901
  passThroughUrl = new URL(req.url);
2901
2902
  params = new URLSearchParams(passThroughUrl.search);
@@ -2913,17 +2914,17 @@ function _route$8() {
2913
2914
  }
2914
2915
  }, _callee);
2915
2916
  }));
2916
- return _route$8.apply(this, arguments);
2917
+ return _route$9.apply(this, arguments);
2917
2918
  }
2918
- function matches$8(configRoutes, request) {
2919
- return urlMatches(request.url, configRoutes[key$5]);
2919
+ function matches$9(configRoutes, request) {
2920
+ return urlMatches(request.url, configRoutes[key$6]);
2920
2921
  }
2921
2922
 
2922
- function route$7(_x, _x2) {
2923
- return _route$7.apply(this, arguments);
2923
+ function route$8(_x, _x2) {
2924
+ return _route$8.apply(this, arguments);
2924
2925
  }
2925
- function _route$7() {
2926
- _route$7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
2926
+ function _route$8() {
2927
+ _route$8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
2927
2928
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2928
2929
  while (1) switch (_context.prev = _context.next) {
2929
2930
  case 0:
@@ -2937,17 +2938,17 @@ function _route$7() {
2937
2938
  }
2938
2939
  }, _callee);
2939
2940
  }));
2940
- return _route$7.apply(this, arguments);
2941
+ return _route$8.apply(this, arguments);
2941
2942
  }
2942
- function matches$7(configRoutes, request) {
2943
+ function matches$8(configRoutes, request) {
2943
2944
  return urlMatches(request.url, configRoutes.SESSION);
2944
2945
  }
2945
2946
 
2946
- function route$6(_x, _x2) {
2947
- return _route$6.apply(this, arguments);
2947
+ function route$7(_x, _x2) {
2948
+ return _route$7.apply(this, arguments);
2948
2949
  }
2949
- function _route$6() {
2950
- _route$6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
2950
+ function _route$7() {
2951
+ _route$7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
2951
2952
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2952
2953
  while (1) switch (_context.prev = _context.next) {
2953
2954
  case 0:
@@ -2961,17 +2962,17 @@ function _route$6() {
2961
2962
  }
2962
2963
  }, _callee);
2963
2964
  }));
2964
- return _route$6.apply(this, arguments);
2965
+ return _route$7.apply(this, arguments);
2965
2966
  }
2966
- function matches$6(configRoutes, request) {
2967
+ function matches$7(configRoutes, request) {
2967
2968
  return urlMatches(request.url, configRoutes.PROVIDERS);
2968
2969
  }
2969
2970
 
2970
- function route$5(_x, _x2) {
2971
- return _route$5.apply(this, arguments);
2971
+ function route$6(_x, _x2) {
2972
+ return _route$6.apply(this, arguments);
2972
2973
  }
2973
- function _route$5() {
2974
- _route$5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
2974
+ function _route$6() {
2975
+ _route$6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
2975
2976
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2976
2977
  while (1) switch (_context.prev = _context.next) {
2977
2978
  case 0:
@@ -2985,33 +2986,33 @@ function _route$5() {
2985
2986
  }
2986
2987
  }, _callee);
2987
2988
  }));
2988
- return _route$5.apply(this, arguments);
2989
+ return _route$6.apply(this, arguments);
2989
2990
  }
2990
- function matches$5(configRoutes, request) {
2991
+ function matches$6(configRoutes, request) {
2991
2992
  return urlMatches(request.url, configRoutes.CSRF);
2992
2993
  }
2993
2994
 
2994
- var key$4 = 'CALLBACK';
2995
- function route$4(_x, _x2) {
2996
- return _route$4.apply(this, arguments);
2995
+ var key$5 = 'CALLBACK';
2996
+ function route$5(_x, _x2) {
2997
+ return _route$5.apply(this, arguments);
2997
2998
  }
2998
- function _route$4() {
2999
- _route$4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request$1, config) {
2999
+ function _route$5() {
3000
+ _route$5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
3000
3001
  var _Logger, error, _URL$pathname$split$r, provider, passThroughUrl, params, url, res, location;
3001
3002
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3002
3003
  while (1) switch (_context.prev = _context.next) {
3003
3004
  case 0:
3004
3005
  _Logger = Logger(_extends({}, config, {
3005
3006
  debug: config.debug
3006
- }), "[ROUTES][" + key$4 + "]"), error = _Logger.error;
3007
- _URL$pathname$split$r = new URL(request$1.url).pathname.split('/').reverse(), provider = _URL$pathname$split$r[0];
3008
- passThroughUrl = new URL(request$1.url);
3007
+ }), "[ROUTES][" + key$5 + "]"), error = _Logger.error;
3008
+ _URL$pathname$split$r = new URL(req.url).pathname.split('/').reverse(), provider = _URL$pathname$split$r[0];
3009
+ passThroughUrl = new URL(req.url);
3009
3010
  params = new URLSearchParams(passThroughUrl.search);
3010
- url = proxyRoutes(config).CALLBACK + "/" + provider + (params.toString() !== '' ? "?" + params.toString() : '');
3011
+ url = proxyRoutes(config)[key$5] + "/" + provider + (params.toString() !== '' ? "?" + params.toString() : '');
3011
3012
  _context.next = 7;
3012
3013
  return request(url, {
3013
- request: request$1,
3014
- method: request$1.method
3014
+ request: req,
3015
+ method: req.method
3015
3016
  }, config)["catch"](function (e) {
3016
3017
  error('an error as occurred', e);
3017
3018
  });
@@ -3037,30 +3038,30 @@ function _route$4() {
3037
3038
  }
3038
3039
  }, _callee);
3039
3040
  }));
3040
- return _route$4.apply(this, arguments);
3041
+ return _route$5.apply(this, arguments);
3041
3042
  }
3042
- function matches$4(configRoutes, request) {
3043
+ function matches$5(configRoutes, request) {
3043
3044
  return urlMatches(request.url, configRoutes.CALLBACK);
3044
3045
  }
3045
3046
 
3046
- var key$3 = 'SIGNOUT';
3047
- function route$3(_x, _x2) {
3048
- return _route$3.apply(this, arguments);
3047
+ var key$4 = 'SIGNOUT';
3048
+ function route$4(_x, _x2) {
3049
+ return _route$4.apply(this, arguments);
3049
3050
  }
3050
- function _route$3() {
3051
- _route$3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request$1, config) {
3051
+ function _route$4() {
3052
+ _route$4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request$1, config) {
3052
3053
  var url, init, _URL$pathname$split$r, provider, res;
3053
3054
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3054
3055
  while (1) switch (_context.prev = _context.next) {
3055
3056
  case 0:
3056
- url = proxyRoutes(config)[key$3];
3057
+ url = proxyRoutes(config)[key$4];
3057
3058
  init = {
3058
3059
  method: request$1.method
3059
3060
  };
3060
3061
  if (request$1.method === 'POST') {
3061
3062
  init.body = request$1.body;
3062
3063
  _URL$pathname$split$r = new URL(request$1.url).pathname.split('/').reverse(), provider = _URL$pathname$split$r[0];
3063
- url = proxyRoutes(config)[key$3] + "/" + provider;
3064
+ url = proxyRoutes(config)[key$4] + "/" + provider;
3064
3065
  }
3065
3066
  _context.next = 5;
3066
3067
  return request(url, _extends({}, init, {
@@ -3075,13 +3076,38 @@ function _route$3() {
3075
3076
  }
3076
3077
  }, _callee);
3077
3078
  }));
3079
+ return _route$4.apply(this, arguments);
3080
+ }
3081
+ function matches$4(configRoutes, request) {
3082
+ return urlMatches(request.url, configRoutes[key$4]);
3083
+ }
3084
+
3085
+ var key$3 = 'ERROR';
3086
+ function route$3(_x, _x2) {
3087
+ return _route$3.apply(this, arguments);
3088
+ }
3089
+ function _route$3() {
3090
+ _route$3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
3091
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3092
+ while (1) switch (_context.prev = _context.next) {
3093
+ case 0:
3094
+ return _context.abrupt("return", request(proxyRoutes(config)[key$3], {
3095
+ method: req.method,
3096
+ request: req
3097
+ }, config));
3098
+ case 1:
3099
+ case "end":
3100
+ return _context.stop();
3101
+ }
3102
+ }, _callee);
3103
+ }));
3078
3104
  return _route$3.apply(this, arguments);
3079
3105
  }
3080
3106
  function matches$3(configRoutes, request) {
3081
3107
  return urlMatches(request.url, configRoutes[key$3]);
3082
3108
  }
3083
3109
 
3084
- var key$2 = 'ERROR';
3110
+ var key$2 = 'VERIFY_REQUEST';
3085
3111
  function route$2(_x, _x2) {
3086
3112
  return _route$2.apply(this, arguments);
3087
3113
  }
@@ -3106,20 +3132,43 @@ function matches$2(configRoutes, request) {
3106
3132
  return urlMatches(request.url, configRoutes[key$2]);
3107
3133
  }
3108
3134
 
3109
- var key$1 = 'VERIFY_REQUEST';
3135
+ var key$1 = 'PASSWORD_RESET';
3110
3136
  function route$1(_x, _x2) {
3111
3137
  return _route$1.apply(this, arguments);
3112
3138
  }
3113
3139
  function _route$1() {
3114
3140
  _route$1 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
3141
+ var url, _URL, searchParams, res, location;
3115
3142
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3116
3143
  while (1) switch (_context.prev = _context.next) {
3117
3144
  case 0:
3118
- return _context.abrupt("return", request(proxyRoutes(config)[key$1], {
3145
+ url = proxyRoutes(config)[key$1];
3146
+ _URL = new URL(req.url), searchParams = _URL.searchParams;
3147
+ if (searchParams.size > 0) {
3148
+ url = url + "?" + searchParams.toString();
3149
+ }
3150
+ _context.next = 5;
3151
+ return request(url, {
3119
3152
  method: req.method,
3120
3153
  request: req
3121
- }, config));
3122
- case 1:
3154
+ }, config);
3155
+ case 5:
3156
+ res = _context.sent;
3157
+ location = res == null ? void 0 : res.headers.get('location');
3158
+ if (!location) {
3159
+ _context.next = 9;
3160
+ break;
3161
+ }
3162
+ return _context.abrupt("return", new Response(res == null ? void 0 : res.body, {
3163
+ status: 302,
3164
+ headers: res == null ? void 0 : res.headers
3165
+ }));
3166
+ case 9:
3167
+ return _context.abrupt("return", new Response(res == null ? void 0 : res.body, {
3168
+ status: res == null ? void 0 : res.status,
3169
+ headers: res == null ? void 0 : res.headers
3170
+ }));
3171
+ case 10:
3123
3172
  case "end":
3124
3173
  return _context.stop();
3125
3174
  }
@@ -3128,7 +3177,7 @@ function _route$1() {
3128
3177
  return _route$1.apply(this, arguments);
3129
3178
  }
3130
3179
  function matches$1(configRoutes, request) {
3131
- return urlMatches(request.url, configRoutes[key$1]);
3180
+ return urlMatches(request.url, configRoutes.PASSWORD_RESET);
3132
3181
  }
3133
3182
 
3134
3183
  function GETTER(configRoutes, config) {
@@ -3140,95 +3189,102 @@ function GETTER(configRoutes, config) {
3140
3189
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3141
3190
  while (1) switch (_context.prev = _context.next) {
3142
3191
  case 0:
3143
- if (!matches$c(configRoutes, req)) {
3192
+ if (!matches$d(configRoutes, req)) {
3144
3193
  _context.next = 3;
3145
3194
  break;
3146
3195
  }
3147
3196
  info('matches me');
3148
- return _context.abrupt("return", route$c(req, config));
3197
+ return _context.abrupt("return", route$d(req, config));
3149
3198
  case 3:
3150
- if (!matches$a(configRoutes, req)) {
3199
+ if (!matches$b(configRoutes, req)) {
3151
3200
  _context.next = 6;
3152
3201
  break;
3153
3202
  }
3154
3203
  info('matches tenant users');
3155
- return _context.abrupt("return", route$a(req, config));
3204
+ return _context.abrupt("return", route$b(req, config));
3156
3205
  case 6:
3157
- if (!matches$b(configRoutes, req)) {
3206
+ if (!matches$c(configRoutes, req)) {
3158
3207
  _context.next = 9;
3159
3208
  break;
3160
3209
  }
3161
3210
  info('matches users');
3162
- return _context.abrupt("return", route$b(req, config));
3211
+ return _context.abrupt("return", route$c(req, config));
3163
3212
  case 9:
3164
- if (!matches$9(configRoutes, req)) {
3213
+ if (!matches$a(configRoutes, req)) {
3165
3214
  _context.next = 12;
3166
3215
  break;
3167
3216
  }
3168
3217
  info('matches tenants');
3169
- return _context.abrupt("return", route$9(req, config));
3218
+ return _context.abrupt("return", route$a(req, config));
3170
3219
  case 12:
3171
- if (!matches$7(configRoutes, req)) {
3220
+ if (!matches$8(configRoutes, req)) {
3172
3221
  _context.next = 15;
3173
3222
  break;
3174
3223
  }
3175
3224
  info('matches session');
3176
- return _context.abrupt("return", route$7(req, config));
3225
+ return _context.abrupt("return", route$8(req, config));
3177
3226
  case 15:
3178
- if (!matches$8(configRoutes, req)) {
3227
+ if (!matches$9(configRoutes, req)) {
3179
3228
  _context.next = 18;
3180
3229
  break;
3181
3230
  }
3182
3231
  info('matches signin');
3183
- return _context.abrupt("return", route$8(req, config));
3232
+ return _context.abrupt("return", route$9(req, config));
3184
3233
  case 18:
3185
- if (!matches$6(configRoutes, req)) {
3234
+ if (!matches$7(configRoutes, req)) {
3186
3235
  _context.next = 21;
3187
3236
  break;
3188
3237
  }
3189
3238
  info('matches providers');
3190
- return _context.abrupt("return", route$6(req, config));
3239
+ return _context.abrupt("return", route$7(req, config));
3191
3240
  case 21:
3192
- if (!matches$5(configRoutes, req)) {
3241
+ if (!matches$6(configRoutes, req)) {
3193
3242
  _context.next = 24;
3194
3243
  break;
3195
3244
  }
3196
3245
  info('matches csrf');
3197
- return _context.abrupt("return", route$5(req, config));
3246
+ return _context.abrupt("return", route$6(req, config));
3198
3247
  case 24:
3199
- if (!matches$4(configRoutes, req)) {
3248
+ if (!matches$1(configRoutes, req)) {
3200
3249
  _context.next = 27;
3201
3250
  break;
3202
3251
  }
3203
- info('matches callback');
3204
- return _context.abrupt("return", route$4(req, config));
3252
+ info('matches password reset');
3253
+ return _context.abrupt("return", route$1(req, config));
3205
3254
  case 27:
3206
- if (!matches$3(configRoutes, req)) {
3255
+ if (!matches$5(configRoutes, req)) {
3207
3256
  _context.next = 30;
3208
3257
  break;
3209
3258
  }
3210
- info('matches signout');
3211
- return _context.abrupt("return", route$3(req, config));
3259
+ info('matches callback');
3260
+ return _context.abrupt("return", route$5(req, config));
3212
3261
  case 30:
3213
- if (!matches$1(configRoutes, req)) {
3262
+ if (!matches$4(configRoutes, req)) {
3214
3263
  _context.next = 33;
3215
3264
  break;
3216
3265
  }
3217
- info('matches verify-request');
3218
- return _context.abrupt("return", route$1(req, config));
3266
+ info('matches signout');
3267
+ return _context.abrupt("return", route$4(req, config));
3219
3268
  case 33:
3220
3269
  if (!matches$2(configRoutes, req)) {
3221
3270
  _context.next = 36;
3222
3271
  break;
3223
3272
  }
3224
- info('matches error');
3273
+ info('matches verify-request');
3225
3274
  return _context.abrupt("return", route$2(req, config));
3226
3275
  case 36:
3276
+ if (!matches$3(configRoutes, req)) {
3277
+ _context.next = 39;
3278
+ break;
3279
+ }
3280
+ info('matches error');
3281
+ return _context.abrupt("return", route$3(req, config));
3282
+ case 39:
3227
3283
  warn('No GET routes matched');
3228
3284
  return _context.abrupt("return", new Response(null, {
3229
3285
  status: 404
3230
3286
  }));
3231
- case 38:
3287
+ case 41:
3232
3288
  case "end":
3233
3289
  return _context.stop();
3234
3290
  }
@@ -3372,12 +3428,12 @@ function POSTER(configRoutes, config) {
3372
3428
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3373
3429
  while (1) switch (_context.prev = _context.next) {
3374
3430
  case 0:
3375
- if (!matches$a(configRoutes, req)) {
3431
+ if (!matches$b(configRoutes, req)) {
3376
3432
  _context.next = 3;
3377
3433
  break;
3378
3434
  }
3379
3435
  info('matches tenant users');
3380
- return _context.abrupt("return", route$a(req, config));
3436
+ return _context.abrupt("return", route$b(req, config));
3381
3437
  case 3:
3382
3438
  if (!matches(configRoutes, req)) {
3383
3439
  _context.next = 6;
@@ -3386,67 +3442,74 @@ function POSTER(configRoutes, config) {
3386
3442
  info('matches signup');
3387
3443
  return _context.abrupt("return", route(req, config));
3388
3444
  case 6:
3389
- if (!matches$b(configRoutes, req)) {
3445
+ if (!matches$c(configRoutes, req)) {
3390
3446
  _context.next = 9;
3391
3447
  break;
3392
3448
  }
3393
3449
  info('matches users');
3394
- return _context.abrupt("return", route$b(req, config));
3450
+ return _context.abrupt("return", route$c(req, config));
3395
3451
  case 9:
3396
- if (!matches$9(configRoutes, req)) {
3452
+ if (!matches$a(configRoutes, req)) {
3397
3453
  _context.next = 12;
3398
3454
  break;
3399
3455
  }
3400
3456
  info('matches tenants');
3401
- return _context.abrupt("return", route$9(req, config));
3457
+ return _context.abrupt("return", route$a(req, config));
3402
3458
  case 12:
3403
- if (!matches$7(configRoutes, req)) {
3459
+ if (!matches$8(configRoutes, req)) {
3404
3460
  _context.next = 15;
3405
3461
  break;
3406
3462
  }
3407
3463
  info('matches session');
3408
- return _context.abrupt("return", route$7(req, config));
3464
+ return _context.abrupt("return", route$8(req, config));
3409
3465
  case 15:
3410
- if (!matches$8(configRoutes, req)) {
3466
+ if (!matches$9(configRoutes, req)) {
3411
3467
  _context.next = 18;
3412
3468
  break;
3413
3469
  }
3414
3470
  info('matches signin');
3415
- return _context.abrupt("return", route$8(req, config));
3471
+ return _context.abrupt("return", route$9(req, config));
3416
3472
  case 18:
3417
- if (!matches$6(configRoutes, req)) {
3473
+ if (!matches$1(configRoutes, req)) {
3418
3474
  _context.next = 21;
3419
3475
  break;
3420
3476
  }
3421
- info('matches providers');
3422
- return _context.abrupt("return", route$6(req, config));
3477
+ info('matches password reset');
3478
+ return _context.abrupt("return", route$1(req, config));
3423
3479
  case 21:
3424
- if (!matches$5(configRoutes, req)) {
3480
+ if (!matches$7(configRoutes, req)) {
3425
3481
  _context.next = 24;
3426
3482
  break;
3427
3483
  }
3428
- info('matches csrf');
3429
- return _context.abrupt("return", route$5(req, config));
3484
+ info('matches providers');
3485
+ return _context.abrupt("return", route$7(req, config));
3430
3486
  case 24:
3431
- if (!matches$4(configRoutes, req)) {
3487
+ if (!matches$6(configRoutes, req)) {
3432
3488
  _context.next = 27;
3433
3489
  break;
3434
3490
  }
3435
- info('matches callback');
3436
- return _context.abrupt("return", route$4(req, config));
3491
+ info('matches csrf');
3492
+ return _context.abrupt("return", route$6(req, config));
3437
3493
  case 27:
3438
- if (!matches$3(configRoutes, req)) {
3494
+ if (!matches$5(configRoutes, req)) {
3439
3495
  _context.next = 30;
3440
3496
  break;
3441
3497
  }
3442
- info('matches signout');
3443
- return _context.abrupt("return", route$3(req, config));
3498
+ info('matches callback');
3499
+ return _context.abrupt("return", route$5(req, config));
3444
3500
  case 30:
3501
+ if (!matches$4(configRoutes, req)) {
3502
+ _context.next = 33;
3503
+ break;
3504
+ }
3505
+ info('matches signout');
3506
+ return _context.abrupt("return", route$4(req, config));
3507
+ case 33:
3445
3508
  warn('No POST routes matched');
3446
3509
  return _context.abrupt("return", new Response(null, {
3447
3510
  status: 404
3448
3511
  }));
3449
- case 32:
3512
+ case 35:
3450
3513
  case "end":
3451
3514
  return _context.stop();
3452
3515
  }
@@ -3468,19 +3531,19 @@ function DELETER(configRoutes, config) {
3468
3531
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3469
3532
  while (1) switch (_context.prev = _context.next) {
3470
3533
  case 0:
3471
- if (!matches$a(configRoutes, req)) {
3534
+ if (!matches$b(configRoutes, req)) {
3472
3535
  _context.next = 3;
3473
3536
  break;
3474
3537
  }
3475
3538
  info('matches tenant users');
3476
- return _context.abrupt("return", route$a(req, config));
3539
+ return _context.abrupt("return", route$b(req, config));
3477
3540
  case 3:
3478
- if (!matches$9(configRoutes, req)) {
3541
+ if (!matches$a(configRoutes, req)) {
3479
3542
  _context.next = 6;
3480
3543
  break;
3481
3544
  }
3482
3545
  info('matches tenants');
3483
- return _context.abrupt("return", route$9(req, config));
3546
+ return _context.abrupt("return", route$a(req, config));
3484
3547
  case 6:
3485
3548
  warn('No DELETE routes matched');
3486
3549
  return _context.abrupt("return", new Response(null, {
@@ -3508,32 +3571,39 @@ function PUTER(configRoutes, config) {
3508
3571
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3509
3572
  while (1) switch (_context.prev = _context.next) {
3510
3573
  case 0:
3511
- if (!matches$a(configRoutes, req)) {
3574
+ if (!matches$b(configRoutes, req)) {
3512
3575
  _context.next = 3;
3513
3576
  break;
3514
3577
  }
3515
3578
  info('matches tenant users');
3516
- return _context.abrupt("return", route$a(req, config));
3579
+ return _context.abrupt("return", route$b(req, config));
3517
3580
  case 3:
3518
- if (!matches$b(configRoutes, req)) {
3581
+ if (!matches$c(configRoutes, req)) {
3519
3582
  _context.next = 6;
3520
3583
  break;
3521
3584
  }
3522
3585
  info('matches users');
3523
- return _context.abrupt("return", route$b(req, config));
3586
+ return _context.abrupt("return", route$c(req, config));
3524
3587
  case 6:
3525
- if (!matches$9(configRoutes, req)) {
3588
+ if (!matches$a(configRoutes, req)) {
3526
3589
  _context.next = 9;
3527
3590
  break;
3528
3591
  }
3529
3592
  info('matches tenants');
3530
- return _context.abrupt("return", route$9(req, config));
3593
+ return _context.abrupt("return", route$a(req, config));
3531
3594
  case 9:
3595
+ if (!matches$1(configRoutes, req)) {
3596
+ _context.next = 12;
3597
+ break;
3598
+ }
3599
+ info('matches reset password');
3600
+ return _context.abrupt("return", route$1(req, config));
3601
+ case 12:
3532
3602
  warn('No PUT routes matched');
3533
3603
  return _context.abrupt("return", new Response(null, {
3534
3604
  status: 404
3535
3605
  }));
3536
- case 11:
3606
+ case 14:
3537
3607
  case "end":
3538
3608
  return _context.stop();
3539
3609
  }
@@ -3572,6 +3642,7 @@ var appRoutes = function appRoutes(prefix) {
3572
3642
  SIGNOUT: prefix + "/auth/signout",
3573
3643
  ERROR: prefix + "/auth/error",
3574
3644
  VERIFY_REQUEST: prefix + "/auth/verify-request",
3645
+ PASSWORD_RESET: prefix + "/auth/reset-password",
3575
3646
  ME: prefix + "/me",
3576
3647
  USERS: prefix + "/users",
3577
3648
  TENANTS: prefix + "/tenants",