forked from cartsnitch/cartsnitch
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 53e802746c |
@@ -95,7 +95,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
CHROME_PATH=$(find /home/runner/.cache/ms-playwright -name chrome -type f 2>/dev/null | head -1)
|
CHROME_PATH=$(find /home/runner/.cache/ms-playwright -name chrome -type f 2>/dev/null | head -1)
|
||||||
npm install -g @lhci/cli
|
npm install -g @lhci/cli
|
||||||
CHROME_PATH="$CHROME_PATH" lhci autorun --chrome-flags="--headless=new --no-sandbox --disable-gpu --disable-dev-shm-usage"
|
LHCI_CHROME_PATH="$CHROME_PATH" lhci autorun
|
||||||
|
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: runners-cartsnitch
|
runs-on: runners-cartsnitch
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
|
|
||||||
from fastapi import APIRouter, FastAPI
|
from fastapi import FastAPI
|
||||||
|
|
||||||
from cartsnitch_api.auth.routes import router as auth_router
|
from cartsnitch_api.auth.routes import router as auth_router
|
||||||
from cartsnitch_api.middleware.cors import add_cors_middleware
|
from cartsnitch_api.middleware.cors import add_cors_middleware
|
||||||
@@ -46,19 +46,15 @@ def create_app() -> FastAPI:
|
|||||||
# Routers
|
# Routers
|
||||||
app.include_router(health_router)
|
app.include_router(health_router)
|
||||||
app.include_router(auth_router)
|
app.include_router(auth_router)
|
||||||
|
app.include_router(stores_router)
|
||||||
# Data endpoints mounted under /api/v1
|
app.include_router(purchases_router)
|
||||||
v1_router = APIRouter(prefix="/api/v1")
|
app.include_router(products_router)
|
||||||
v1_router.include_router(stores_router)
|
app.include_router(prices_router)
|
||||||
v1_router.include_router(purchases_router)
|
app.include_router(coupons_router)
|
||||||
v1_router.include_router(products_router)
|
app.include_router(shopping_router)
|
||||||
v1_router.include_router(prices_router)
|
app.include_router(alerts_router)
|
||||||
v1_router.include_router(coupons_router)
|
app.include_router(scraping_router)
|
||||||
v1_router.include_router(shopping_router)
|
app.include_router(public_router)
|
||||||
v1_router.include_router(alerts_router)
|
|
||||||
v1_router.include_router(scraping_router)
|
|
||||||
v1_router.include_router(public_router)
|
|
||||||
app.include_router(v1_router)
|
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|||||||
+1
-6
@@ -3,12 +3,7 @@
|
|||||||
"collect": {
|
"collect": {
|
||||||
"staticDistDir": "./dist",
|
"staticDistDir": "./dist",
|
||||||
"url": ["http://localhost:4173/"],
|
"url": ["http://localhost:4173/"],
|
||||||
"numberOfRuns": 1,
|
"numberOfRuns": 1
|
||||||
"settings": {
|
|
||||||
"chromeFlags": ["--headless=new", "--no-sandbox", "--disable-gpu", "--disable-dev-shm-usage"],
|
|
||||||
"skipAudits": ["bf-cache"],
|
|
||||||
"disableFullPageScreenshot": true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"assert": {
|
"assert": {
|
||||||
"assertions": {
|
"assertions": {
|
||||||
|
|||||||
+1
-7
@@ -31,14 +31,8 @@ export function Login() {
|
|||||||
throw new Error(authError.message ?? 'Sign in failed')
|
throw new Error(authError.message ?? 'Sign in failed')
|
||||||
}
|
}
|
||||||
|
|
||||||
// After successful signIn, force a session fetch to confirm the cookie is set
|
setAuthenticated(true)
|
||||||
// before navigating to the protected route
|
|
||||||
const sessionResult = await authClient.getSession()
|
|
||||||
if (sessionResult.data) {
|
|
||||||
navigate('/')
|
navigate('/')
|
||||||
} else {
|
|
||||||
setError('Sign in failed. Please try again.')
|
|
||||||
}
|
|
||||||
} catch {
|
} catch {
|
||||||
if (import.meta.env.VITE_MOCK_AUTH === 'true') {
|
if (import.meta.env.VITE_MOCK_AUTH === 'true') {
|
||||||
setAuthenticated(true)
|
setAuthenticated(true)
|
||||||
|
|||||||
@@ -38,15 +38,8 @@ export function Register() {
|
|||||||
throw new Error(authError.message ?? 'Registration failed')
|
throw new Error(authError.message ?? 'Registration failed')
|
||||||
}
|
}
|
||||||
|
|
||||||
// After successful signUp, force a session fetch to confirm the cookie is set
|
setAuthenticated(true)
|
||||||
// before navigating to the protected route
|
|
||||||
const sessionResult = await authClient.getSession()
|
|
||||||
if (sessionResult.data) {
|
|
||||||
navigate('/')
|
navigate('/')
|
||||||
} else {
|
|
||||||
// Session not established — show success message and link to login
|
|
||||||
setError('Account created! Please sign in.')
|
|
||||||
}
|
|
||||||
} catch {
|
} catch {
|
||||||
if (import.meta.env.VITE_MOCK_AUTH === 'true') {
|
if (import.meta.env.VITE_MOCK_AUTH === 'true') {
|
||||||
setAuthenticated(true)
|
setAuthenticated(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user