Skip to content

Commit de6c1a6

Browse files
authored
statusLookup (#933)
- **add base-url api shimming** - **bump: version 0.1.13-9**
2 parents 926760c + 5a9aa77 commit de6c1a6

File tree

13 files changed

+31
-18
lines changed

13 files changed

+31
-18
lines changed

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.13-8",
6+
"version": "0.1.13-9",
77
"type": "module",
88
"description": "CLI scaffolding tool for vue-skuilder projects",
99
"bin": {

packages/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.13-8",
6+
"version": "0.1.13-9",
77
"license": "MIT",
88
"main": "dist/index.js",
99
"module": "dist/index.esm.js",

packages/common-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.13-8",
6+
"version": "0.1.13-9",
77
"main": "./dist/common-ui.umd.js",
88
"module": "./dist/common-ui.es.js",
99
"types": "./dist/index.d.ts",

packages/common-ui/src/services/authAPI.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
/**
22
* Authentication API service for interacting with Express backend auth endpoints.
3-
* Uses relative paths (same-origin) to avoid ENV coupling.
3+
* Uses configurable API base path from environment or falls back to relative paths.
44
*/
55

6+
// Get API base path from environment, defaulting to empty string for relative paths
7+
const getApiBase = (): string => {
8+
if (typeof import.meta !== 'undefined' && import.meta.env) {
9+
const base = import.meta.env.VITE_API_BASE_URL;
10+
if (base) {
11+
// Remove trailing slash if present, ensure leading slash
12+
const cleaned = base.replace(/\/$/, '');
13+
return cleaned.startsWith('/') ? cleaned : `/${cleaned}`;
14+
}
15+
}
16+
return '';
17+
};
18+
619
export interface AuthResponse {
720
ok: boolean;
821
error?: string;
@@ -38,7 +51,7 @@ export async function sendVerificationEmail(
3851
body.origin = origin;
3952
}
4053

41-
const response = await fetch('/auth/send-verification', {
54+
const response = await fetch(`${getApiBase()}/auth/send-verification`, {
4255
method: 'POST',
4356
headers: { 'Content-Type': 'application/json' },
4457
credentials: 'include',
@@ -69,7 +82,7 @@ export async function sendVerificationEmail(
6982
*/
7083
export async function verifyEmail(token: string): Promise<VerifyEmailResponse> {
7184
try {
72-
const response = await fetch('/auth/verify', {
85+
const response = await fetch(`${getApiBase()}/auth/verify`, {
7386
method: 'POST',
7487
headers: { 'Content-Type': 'application/json' },
7588
credentials: 'include',
@@ -98,7 +111,7 @@ export async function verifyEmail(token: string): Promise<VerifyEmailResponse> {
98111
*/
99112
export async function getUserStatus(): Promise<UserStatusResponse> {
100113
try {
101-
const response = await fetch('/auth/status', {
114+
const response = await fetch(`${getApiBase()}/auth/status`, {
102115
method: 'GET',
103116
headers: { 'Content-Type': 'application/json' },
104117
credentials: 'include',
@@ -138,7 +151,7 @@ export async function requestPasswordReset(
138151
body.origin = origin;
139152
}
140153

141-
const response = await fetch('/auth/request-reset', {
154+
const response = await fetch(`${getApiBase()}/auth/request-reset`, {
142155
method: 'POST',
143156
headers: { 'Content-Type': 'application/json' },
144157
credentials: 'include',
@@ -169,7 +182,7 @@ export async function resetPassword(
169182
newPassword: string
170183
): Promise<AuthResponse> {
171184
try {
172-
const response = await fetch('/auth/reset-password', {
185+
const response = await fetch(`${getApiBase()}/auth/reset-password`, {
173186
method: 'POST',
174187
headers: { 'Content-Type': 'application/json' },
175188
credentials: 'include',

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.13-8",
6+
"version": "0.1.13-9",
77
"type": "module",
88
"main": "dist/index.js",
99
"module": "dist/index.mjs",

packages/courseware/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.13-8",
6+
"version": "0.1.13-9",
77
"type": "module",
88
"main": "./dist/index.cjs.js",
99
"module": "./dist/index.mjs",

packages/db/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.13-8",
6+
"version": "0.1.13-9",
77
"description": "Database layer for vue-skuilder",
88
"main": "dist/index.js",
99
"module": "dist/index.mjs",

packages/edit-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.13-8",
6+
"version": "0.1.13-9",
77
"main": "./dist/edit-ui.umd.js",
88
"module": "./dist/edit-ui.es.js",
99
"types": "./dist/index.d.ts",

packages/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.13-8",
6+
"version": "0.1.13-9",
77
"description": "an API",
88
"main": "dist/index.js",
99
"type": "module",

packages/mcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue-skuilder/mcp",
3-
"version": "0.1.13-8",
3+
"version": "0.1.13-9",
44
"type": "module",
55
"exports": {
66
".": {

0 commit comments

Comments
 (0)