@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.
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  'use strict';
2
3
 
3
4
  var react = require('react');
@@ -8,7 +9,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
9
 
9
10
  var axios__default = /*#__PURE__*/_interopDefault(axios);
10
11
 
11
- // src/react/components/LoginForm.tsx
12
12
  var HttpClient = class {
13
13
  constructor(baseUrl, defaultHeaders = {}) {
14
14
  this.csrfToken = null;
@@ -403,21 +403,21 @@ var AuthService = class {
403
403
  if (!this.token) {
404
404
  throw new Error("Not authenticated");
405
405
  }
406
- const response = await this.httpClient.get("/api/v1/session");
406
+ const response = await this.httpClient.get("/api/v1/sessions");
407
407
  return response;
408
408
  }
409
409
  async revokeSession(sessionId) {
410
410
  if (!this.token) {
411
411
  throw new Error("Not authenticated");
412
412
  }
413
- const response = await this.httpClient.delete(`/api/v1/session/${sessionId}`);
413
+ const response = await this.httpClient.delete(`/api/v1/sessions/${sessionId}`);
414
414
  return response;
415
415
  }
416
416
  async revokeAllSessions() {
417
417
  if (!this.token) {
418
418
  throw new Error("Not authenticated");
419
419
  }
420
- const response = await this.httpClient.delete("/api/v1/session/revoke/all");
420
+ const response = await this.httpClient.delete("/api/v1/sessions/revoke/all");
421
421
  this.token = null;
422
422
  this.httpClient.removeAuthToken();
423
423
  this.removeTokenFromStorage();