@bagelink/auth 1.15.413 → 1.15.419

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.cjs CHANGED
@@ -1233,8 +1233,8 @@ function useAuth() {
1233
1233
  const { data: response } = await api.verifySMS(data);
1234
1234
  if (response.success === true && response.requires_verification !== true) {
1235
1235
  await checkAuth();
1236
+ emitter.emit(AuthState.LOGIN);
1236
1237
  }
1237
- emitter.emit(AuthState.LOGIN);
1238
1238
  return response;
1239
1239
  }
1240
1240
  async function sendOTP(data) {
@@ -1251,8 +1251,8 @@ function useAuth() {
1251
1251
  const { data: response } = await api.verifyEmailToken(data);
1252
1252
  if (response.success === true && response.requires_verification !== true) {
1253
1253
  await checkAuth();
1254
+ emitter.emit(AuthState.LOGIN);
1254
1255
  }
1255
- emitter.emit(AuthState.LOGIN);
1256
1256
  return response;
1257
1257
  }
1258
1258
  async function generateLoginToken(data = {}) {
@@ -1567,8 +1567,9 @@ function authGuard() {
1567
1567
  const config = getRedirectConfig();
1568
1568
  const requiresAuth = to.meta[config.authMetaKey];
1569
1569
  const requiresNoAuth = config.noAuthRoutes.includes(to.name);
1570
+ const skipsAuthBootstrap = to.meta.skipAuthBootstrap === true;
1570
1571
  try {
1571
- if (!authInitialized) {
1572
+ if (!authInitialized && !skipsAuthBootstrap) {
1572
1573
  await auth.checkAuth();
1573
1574
  authInitialized = true;
1574
1575
  }
package/dist/index.mjs CHANGED
@@ -1231,8 +1231,8 @@ function useAuth() {
1231
1231
  const { data: response } = await api.verifySMS(data);
1232
1232
  if (response.success === true && response.requires_verification !== true) {
1233
1233
  await checkAuth();
1234
+ emitter.emit(AuthState.LOGIN);
1234
1235
  }
1235
- emitter.emit(AuthState.LOGIN);
1236
1236
  return response;
1237
1237
  }
1238
1238
  async function sendOTP(data) {
@@ -1249,8 +1249,8 @@ function useAuth() {
1249
1249
  const { data: response } = await api.verifyEmailToken(data);
1250
1250
  if (response.success === true && response.requires_verification !== true) {
1251
1251
  await checkAuth();
1252
+ emitter.emit(AuthState.LOGIN);
1252
1253
  }
1253
- emitter.emit(AuthState.LOGIN);
1254
1254
  return response;
1255
1255
  }
1256
1256
  async function generateLoginToken(data = {}) {
@@ -1565,8 +1565,9 @@ function authGuard() {
1565
1565
  const config = getRedirectConfig();
1566
1566
  const requiresAuth = to.meta[config.authMetaKey];
1567
1567
  const requiresNoAuth = config.noAuthRoutes.includes(to.name);
1568
+ const skipsAuthBootstrap = to.meta.skipAuthBootstrap === true;
1568
1569
  try {
1569
- if (!authInitialized) {
1570
+ if (!authInitialized && !skipsAuthBootstrap) {
1570
1571
  await auth.checkAuth();
1571
1572
  authInitialized = true;
1572
1573
  }
package/dist/types.d.ts CHANGED
@@ -233,6 +233,9 @@ export interface EmailTokenSendRequest {
233
233
  export interface EmailTokenVerifyRequest {
234
234
  email: string;
235
235
  token: string;
236
+ nonce: string;
237
+ verification_hash: string;
238
+ timestamp: number;
236
239
  }
237
240
  export interface OTPSendRequest {
238
241
  phone_number: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/auth",
3
3
  "type": "module",
4
- "version": "1.15.413",
4
+ "version": "1.15.419",
5
5
  "description": "Bagelink auth package",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
package/src/router.ts CHANGED
@@ -45,10 +45,11 @@ export function authGuard() {
45
45
 
46
46
  // Check if route is an auth-only page (login, signup, etc)
47
47
  const requiresNoAuth = config.noAuthRoutes.includes(to.name as string)
48
+ const skipsAuthBootstrap = to.meta.skipAuthBootstrap === true
48
49
 
49
50
  try {
50
51
  // Only check auth once on first navigation for performance
51
- if (!authInitialized) {
52
+ if (!authInitialized && !skipsAuthBootstrap) {
52
53
  await auth.checkAuth()
53
54
  authInitialized = true
54
55
  }
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* eslint-disable no-unused-vars */
1
+
2
2
  import type { AxiosResponse } from 'axios'
3
3
 
4
4
  // ============================================
@@ -301,6 +301,9 @@ export interface EmailTokenSendRequest {
301
301
  export interface EmailTokenVerifyRequest {
302
302
  email: string
303
303
  token: string
304
+ nonce: string
305
+ verification_hash: string
306
+ timestamp: number
304
307
  }
305
308
 
306
309
  export interface OTPSendRequest {
package/src/useAuth.ts CHANGED
@@ -341,9 +341,9 @@ export function useAuth() {
341
341
 
342
342
  if (response.success === true && response.requires_verification !== true) {
343
343
  await checkAuth()
344
+ emitter.emit(AuthState.LOGIN)
344
345
  }
345
346
 
346
- emitter.emit(AuthState.LOGIN)
347
347
  return response
348
348
  }
349
349
 
@@ -371,9 +371,9 @@ export function useAuth() {
371
371
 
372
372
  if (response.success === true && response.requires_verification !== true) {
373
373
  await checkAuth()
374
+ emitter.emit(AuthState.LOGIN)
374
375
  }
375
376
 
376
- emitter.emit(AuthState.LOGIN)
377
377
  return response
378
378
  }
379
379