@mesob/auth-hono 0.1.0 → 0.2.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/README.md CHANGED
@@ -131,7 +131,7 @@ const result = await authClient['sign-in'].$post({
131
131
  - `POST /sign-up` - Sign up with email/phone
132
132
  - `POST /sign-in` - Sign in
133
133
  - `POST /sign-out` - Sign out
134
- - `POST /check-user` - Check if user exists
134
+ - `POST /check-account` - Check if account exists
135
135
 
136
136
  ### Profile
137
137
  - `GET /me` - Get current user
@@ -2,6 +2,8 @@ import * as hono from 'hono';
2
2
  import { OpenAPIHono } from '@hono/zod-openapi';
3
3
  import { D as Database } from './index-ULpI-i0z.js';
4
4
 
5
+ type SessionStatus = 'valid' | 'no_cookie' | 'invalid_session' | 'user_not_found' | 'error';
6
+
5
7
  type AuthEnv = {
6
8
  Variables: {
7
9
  config: AuthConfig;
@@ -10,6 +12,7 @@ type AuthEnv = {
10
12
  userId?: string;
11
13
  user?: User;
12
14
  session?: Session;
15
+ sessionStatus?: SessionStatus;
13
16
  };
14
17
  };
15
18
 
@@ -68,8 +71,10 @@ type VerificationConfig = {
68
71
  resendInterval?: string;
69
72
  sendVerificationOTP?: (params: SendVerificationOTPParams) => Promise<void> | void;
70
73
  };
74
+ type PhoneConfig = VerificationConfig & {
75
+ phoneRegex?: RegExp | string;
76
+ };
71
77
  type EmailConfig = VerificationConfig;
72
- type PhoneConfig = VerificationConfig;
73
78
  type SessionConfig = {
74
79
  /** Default session duration (e.g., '7d', '30d'). Default: '7d' */
75
80
  expiresIn: string;
@@ -134,4 +139,4 @@ type MesobAuth = {
134
139
  sessionMiddleware: hono.MiddlewareHandler;
135
140
  };
136
141
 
137
- export type { AuthConfig as A, MesobAuth as M, SendVerificationOTPParams as S, User as U, Session as a, SessionConfig as b };
142
+ export type { AuthConfig as A, MesobAuth as M, SessionStatus as S, User as U, SendVerificationOTPParams as a, Session as b, SessionConfig as c };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AuthConfig, M as MesobAuth } from './index-CScADcDn.js';
2
- export { S as SendVerificationOTPParams, a as Session, U as User } from './index-CScADcDn.js';
1
+ import { A as AuthConfig, M as MesobAuth } from './index-DCxsFKQ2.js';
2
+ export { a as SendVerificationOTPParams, b as Session, S as SessionStatus, U as User } from './index-DCxsFKQ2.js';
3
3
  import { D as Database } from './index-ULpI-i0z.js';
4
4
  export { c as createDatabase } from './index-ULpI-i0z.js';
5
5
  export { cleanupExpiredData, cleanupExpiredSessions, cleanupExpiredVerifications } from './lib/cleanup.js';