@lastshotlabs/bunshot 0.0.7 → 0.0.8
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/routes/auth.js +8 -7
- package/package.json +1 -1
package/dist/routes/auth.js
CHANGED
|
@@ -12,6 +12,7 @@ import { getVerificationToken, deleteVerificationToken, createVerificationToken
|
|
|
12
12
|
const isProd = process.env.NODE_ENV === "production";
|
|
13
13
|
const TokenResponse = z.object({ token: z.string(), emailVerified: z.boolean().optional() });
|
|
14
14
|
const ErrorResponse = z.object({ error: z.string() });
|
|
15
|
+
const tags = ["Auth"];
|
|
15
16
|
const cookieOptions = {
|
|
16
17
|
httpOnly: true,
|
|
17
18
|
secure: isProd,
|
|
@@ -33,7 +34,7 @@ export const createAuthRouter = ({ primaryField, emailVerification, rateLimit })
|
|
|
33
34
|
router.openapi(createRoute({
|
|
34
35
|
method: "post",
|
|
35
36
|
path: "/auth/register",
|
|
36
|
-
tags
|
|
37
|
+
tags,
|
|
37
38
|
request: { body: { content: { "application/json": { schema: RegisterSchema } } } },
|
|
38
39
|
responses: {
|
|
39
40
|
201: { content: { "application/json": { schema: TokenResponse } }, description: "Registered" },
|
|
@@ -55,7 +56,7 @@ export const createAuthRouter = ({ primaryField, emailVerification, rateLimit })
|
|
|
55
56
|
router.openapi(createRoute({
|
|
56
57
|
method: "post",
|
|
57
58
|
path: "/auth/login",
|
|
58
|
-
tags
|
|
59
|
+
tags,
|
|
59
60
|
request: { body: { content: { "application/json": { schema: LoginSchema } } } },
|
|
60
61
|
responses: {
|
|
61
62
|
200: { content: { "application/json": { schema: TokenResponse } }, description: "Logged in" },
|
|
@@ -85,7 +86,7 @@ export const createAuthRouter = ({ primaryField, emailVerification, rateLimit })
|
|
|
85
86
|
router.openapi(createRoute({
|
|
86
87
|
method: "get",
|
|
87
88
|
path: "/auth/me",
|
|
88
|
-
tags
|
|
89
|
+
tags,
|
|
89
90
|
responses: {
|
|
90
91
|
200: {
|
|
91
92
|
content: {
|
|
@@ -113,7 +114,7 @@ export const createAuthRouter = ({ primaryField, emailVerification, rateLimit })
|
|
|
113
114
|
router.openapi(createRoute({
|
|
114
115
|
method: "post",
|
|
115
116
|
path: "/auth/set-password",
|
|
116
|
-
tags
|
|
117
|
+
tags,
|
|
117
118
|
request: { body: { content: { "application/json": { schema: z.object({ password: z.string().min(8) }) } } } },
|
|
118
119
|
responses: {
|
|
119
120
|
200: { content: { "application/json": { schema: z.object({ message: z.string() }) } }, description: "Password set" },
|
|
@@ -134,7 +135,7 @@ export const createAuthRouter = ({ primaryField, emailVerification, rateLimit })
|
|
|
134
135
|
router.openapi(createRoute({
|
|
135
136
|
method: "post",
|
|
136
137
|
path: "/auth/logout",
|
|
137
|
-
tags
|
|
138
|
+
tags,
|
|
138
139
|
responses: {
|
|
139
140
|
200: { content: { "application/json": { schema: z.object({ message: z.string() }) } }, description: "Logged out" },
|
|
140
141
|
},
|
|
@@ -149,7 +150,7 @@ export const createAuthRouter = ({ primaryField, emailVerification, rateLimit })
|
|
|
149
150
|
router.openapi(createRoute({
|
|
150
151
|
method: "post",
|
|
151
152
|
path: "/auth/verify-email",
|
|
152
|
-
tags
|
|
153
|
+
tags,
|
|
153
154
|
request: { body: { content: { "application/json": { schema: z.object({ token: z.string() }) } } } },
|
|
154
155
|
responses: {
|
|
155
156
|
200: { content: { "application/json": { schema: z.object({ message: z.string() }) } }, description: "Email verified" },
|
|
@@ -175,7 +176,7 @@ export const createAuthRouter = ({ primaryField, emailVerification, rateLimit })
|
|
|
175
176
|
router.openapi(createRoute({
|
|
176
177
|
method: "post",
|
|
177
178
|
path: "/auth/resend-verification",
|
|
178
|
-
tags
|
|
179
|
+
tags,
|
|
179
180
|
responses: {
|
|
180
181
|
200: { content: { "application/json": { schema: z.object({ message: z.string() }) } }, description: "Verification email sent" },
|
|
181
182
|
400: { content: { "application/json": { schema: ErrorResponse } }, description: "Already verified" },
|
package/package.json
CHANGED