@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.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import axios from 'axios';
2
3
  import { createContext, useState, useCallback, useEffect, useContext, useRef } from 'react';
3
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -401,21 +402,21 @@ var AuthService = class {
401
402
  if (!this.token) {
402
403
  throw new Error("Not authenticated");
403
404
  }
404
- const response = await this.httpClient.get("/api/v1/session");
405
+ const response = await this.httpClient.get("/api/v1/sessions");
405
406
  return response;
406
407
  }
407
408
  async revokeSession(sessionId) {
408
409
  if (!this.token) {
409
410
  throw new Error("Not authenticated");
410
411
  }
411
- const response = await this.httpClient.delete(`/api/v1/session/${sessionId}`);
412
+ const response = await this.httpClient.delete(`/api/v1/sessions/${sessionId}`);
412
413
  return response;
413
414
  }
414
415
  async revokeAllSessions() {
415
416
  if (!this.token) {
416
417
  throw new Error("Not authenticated");
417
418
  }
418
- const response = await this.httpClient.delete("/api/v1/session/revoke/all");
419
+ const response = await this.httpClient.delete("/api/v1/sessions/revoke/all");
419
420
  this.token = null;
420
421
  this.httpClient.removeAuthToken();
421
422
  this.removeTokenFromStorage();