@thetechfossil/auth2 1.2.2 → 1.2.3

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.d.ts CHANGED
@@ -56,11 +56,13 @@ interface AuthConfig {
56
56
  }
57
57
  interface Session {
58
58
  id: string;
59
- userId: string;
60
- deviceInfo?: string;
59
+ userId?: string;
60
+ token?: string;
61
+ userAgent?: string;
61
62
  ipAddress?: string;
62
- lastActive: string;
63
+ expiresAt: string;
63
64
  createdAt: string;
65
+ updatedAt?: string;
64
66
  }
65
67
  interface MFASetup {
66
68
  success: boolean;
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  'use strict';
2
3
 
3
4
  var axios = require('axios');
@@ -407,21 +408,21 @@ var AuthService = class {
407
408
  if (!this.token) {
408
409
  throw new Error("Not authenticated");
409
410
  }
410
- const response = await this.httpClient.get("/api/v1/session");
411
+ const response = await this.httpClient.get("/api/v1/sessions");
411
412
  return response;
412
413
  }
413
414
  async revokeSession(sessionId) {
414
415
  if (!this.token) {
415
416
  throw new Error("Not authenticated");
416
417
  }
417
- const response = await this.httpClient.delete(`/api/v1/session/${sessionId}`);
418
+ const response = await this.httpClient.delete(`/api/v1/sessions/${sessionId}`);
418
419
  return response;
419
420
  }
420
421
  async revokeAllSessions() {
421
422
  if (!this.token) {
422
423
  throw new Error("Not authenticated");
423
424
  }
424
- const response = await this.httpClient.delete("/api/v1/session/revoke/all");
425
+ const response = await this.httpClient.delete("/api/v1/sessions/revoke/all");
425
426
  this.token = null;
426
427
  this.httpClient.removeAuthToken();
427
428
  this.removeTokenFromStorage();