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