@rpcbase/auth 0.60.0 → 0.62.0
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/{handler-C9aNvw-Q.js → handler-4XBN4nVK.js} +2 -2
- package/dist/{handler-49961uAb.js → handler-BLs8Y-gl.js} +2 -2
- package/dist/{handler-DgTUP3cD.js → handler-D0JXRtpm.js} +3 -3
- package/dist/{handler-ByODvDJo.js → handler-DrTPUoF0.js} +2 -2
- package/dist/{handler-BxA7Jhrs.js → handler-l_ZFKr_v.js} +2 -2
- package/dist/routes.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { loadRbModel } from "@rpcbase/db";
|
|
2
2
|
import { r as restrictSessionMiddleware } from "./middleware-BiMXO6Dq.js";
|
|
3
3
|
import { o as object, s as string, a as array } from "./schemas-KL7REOdt.js";
|
|
4
4
|
const Route = "/api/rb/auth/me";
|
|
@@ -25,7 +25,7 @@ const me = async (_payload, ctx) => {
|
|
|
25
25
|
error: "not_authenticated"
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
const User = await
|
|
28
|
+
const User = await loadRbModel("RBUser", ctx);
|
|
29
29
|
const user = await User.findById(sessionUser.id);
|
|
30
30
|
if (!user) {
|
|
31
31
|
ctx.res.status(404);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { loadRbModel } from "@rpcbase/db";
|
|
2
2
|
import { o as object, b as boolean, s as string } from "./schemas-KL7REOdt.js";
|
|
3
3
|
const Route = "/api/rb/auth/verify-otp";
|
|
4
4
|
const requestSchema = object({
|
|
@@ -13,7 +13,7 @@ object({
|
|
|
13
13
|
tenant_id: string().optional()
|
|
14
14
|
});
|
|
15
15
|
const verifyOtp = async (payload, ctx) => {
|
|
16
|
-
const User = await
|
|
16
|
+
const User = await loadRbModel("RBUser", ctx);
|
|
17
17
|
const parsed = requestSchema.safeParse(payload);
|
|
18
18
|
if (!parsed.success) {
|
|
19
19
|
ctx.res.status(400);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import crypto from "crypto";
|
|
2
|
-
import {
|
|
2
|
+
import { loadRbModel } from "@rpcbase/db";
|
|
3
3
|
import { hashPasswordForStorage, sendEmail } from "@rpcbase/server";
|
|
4
4
|
import { R as Route, r as requestSchema } from "./index-DwX0Y2YV.js";
|
|
5
5
|
const signUp = async (payload, ctx) => {
|
|
6
|
-
const User = await
|
|
7
|
-
const Tenant = await
|
|
6
|
+
const User = await loadRbModel("RBUser", ctx);
|
|
7
|
+
const Tenant = await loadRbModel("RBTenant", ctx);
|
|
8
8
|
const parsed = requestSchema.safeParse(payload);
|
|
9
9
|
if (!parsed.success) {
|
|
10
10
|
ctx.res.status(400);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { loadRbModel } from "@rpcbase/db";
|
|
2
2
|
import { verifyPasswordFromStorage } from "@rpcbase/server";
|
|
3
3
|
import { R as Route, r as requestSchema } from "./index-Bdcryyvv.js";
|
|
4
4
|
const signIn = async (payload, ctx) => {
|
|
5
|
-
const User = await
|
|
5
|
+
const User = await loadRbModel("RBUser", ctx);
|
|
6
6
|
const parsed = requestSchema.safeParse(payload);
|
|
7
7
|
if (!parsed.success) {
|
|
8
8
|
ctx.res.status(400);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import crypto from "crypto";
|
|
2
|
-
import {
|
|
2
|
+
import { loadRbModel } from "@rpcbase/db";
|
|
3
3
|
import { sendEmail } from "@rpcbase/server";
|
|
4
4
|
import { o as object, s as string, b as boolean } from "./schemas-KL7REOdt.js";
|
|
5
5
|
const Route = "/api/rb/auth/resend-otp";
|
|
@@ -11,7 +11,7 @@ object({
|
|
|
11
11
|
error: string().optional()
|
|
12
12
|
});
|
|
13
13
|
const resendOtp = async (payload, ctx) => {
|
|
14
|
-
const User = await
|
|
14
|
+
const User = await loadRbModel("RBUser", ctx);
|
|
15
15
|
const parsed = requestSchema.safeParse(payload);
|
|
16
16
|
if (!parsed.success) {
|
|
17
17
|
ctx.res.status(400);
|
package/dist/routes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const routes = Object.entries({
|
|
2
|
-
.../* @__PURE__ */ Object.assign({ "./api/me/handler.ts": () => import("./handler-
|
|
2
|
+
.../* @__PURE__ */ Object.assign({ "./api/me/handler.ts": () => import("./handler-4XBN4nVK.js"), "./api/resend-otp/handler.ts": () => import("./handler-l_ZFKr_v.js"), "./api/sign-in/handler.ts": () => import("./handler-DrTPUoF0.js"), "./api/sign-out/handler.ts": () => import("./handler-CNHucHrj.js"), "./api/sign-up/handler.ts": () => import("./handler-D0JXRtpm.js"), "./api/verify-otp/handler.ts": () => import("./handler-BLs8Y-gl.js") })
|
|
3
3
|
}).reduce((acc, [path, mod]) => {
|
|
4
4
|
acc[path.replace("./api/", "@rpcbase/auth/api/")] = mod;
|
|
5
5
|
return acc;
|