@iservice365/layer-common 0.2.1 → 0.2.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - c627e9b: Switch to session based auth
8
+
3
9
  ## 0.2.1
4
10
 
5
11
  ### Patch Changes
@@ -4,14 +4,6 @@ export default function useLocalAuth() {
4
4
  const currentUser = useState<TUser | null>("currentUser", () => null);
5
5
 
6
6
  function authenticate() {
7
- // Get access token from cookies
8
- const accessToken = useCookie("accessToken", cookieConfig).value;
9
-
10
- if (!accessToken) {
11
- // Redirect to login page if no access token
12
- navigateTo({ name: "index" });
13
- }
14
-
15
7
  const user = useCookie("user", cookieConfig).value;
16
8
 
17
9
  const { data: getCurrentUserReq, error: getCurrentUserErr } =
@@ -2,9 +2,9 @@ export default defineNuxtRouteMiddleware(async () => {
2
2
  const { cookieConfig } = useRuntimeConfig().public;
3
3
 
4
4
  // Get access token from cookies
5
- const accessToken = useCookie("accessToken", cookieConfig).value;
5
+ const sid = useCookie("sid", cookieConfig).value;
6
6
 
7
- if (!accessToken) {
7
+ if (!sid) {
8
8
  // Redirect to login page if no access token
9
9
  return navigateTo({ name: "index" });
10
10
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@iservice365/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "0.2.1",
5
+ "version": "0.2.2",
6
6
  "main": "./nuxt.config.ts",
7
7
  "publishConfig": {
8
8
  "access": "public"