cobras-auth-nuxt 1.0.0 → 1.0.1

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.
@@ -29,7 +29,7 @@ export default defineNuxtRouteMiddleware(async (to) => {
29
29
  redirectUrl = to.fullPath;
30
30
  }
31
31
  return navigateTo(
32
- `${authConfig.authServiceUrl}/login?redirect_uri=${encodeURIComponent(redirectUrl)}`,
32
+ `${authConfig.authServiceUrl}/api/auth/authorize?redirect_uri=${encodeURIComponent(redirectUrl)}`,
33
33
  { external: true }
34
34
  );
35
35
  }
@@ -12,7 +12,7 @@ export default defineNuxtRouteMiddleware(async (to) => {
12
12
  if (!state.value?.user) {
13
13
  const currentUrl = typeof window !== "undefined" ? window.location.href : to.fullPath;
14
14
  return navigateTo(
15
- `${authConfig.authServiceUrl}/login?redirect_uri=${encodeURIComponent(currentUrl)}`,
15
+ `${authConfig.authServiceUrl}/api/auth/authorize?redirect_uri=${encodeURIComponent(currentUrl)}`,
16
16
  { external: true }
17
17
  );
18
18
  }
@@ -57,8 +57,8 @@ export default defineNuxtPlugin(async (nuxtApp) => {
57
57
  }
58
58
  function login(redirect) {
59
59
  const currentUrl = redirect || window.location.href;
60
- const loginUrl = `${authConfig.authServiceUrl}/login?redirect_uri=${encodeURIComponent(currentUrl)}`;
61
- window.location.href = loginUrl;
60
+ const authorizeUrl = `${authConfig.authServiceUrl}/api/auth/authorize?redirect_uri=${encodeURIComponent(currentUrl)}`;
61
+ window.location.href = authorizeUrl;
62
62
  }
63
63
  async function logout() {
64
64
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cobras-auth-nuxt",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Nuxt 3/4 module for Cobras Auth service - supports internal (SSO) and public modes",
5
5
  "repository": {
6
6
  "type": "git",