Not sure this will work

This commit is contained in:
Keith Stevens
2023-01-22 21:36:52 +09:00
parent 91ea5eab9b
commit ec5bdef719
6 changed files with 20 additions and 1 deletions
+2
View File
@@ -1,6 +1,7 @@
from fastapi import APIRouter
from oasst_backend.api.v1 import (
admin,
auth,
frontend_messages,
frontend_users,
hugging_face,
@@ -23,3 +24,4 @@ api_router.include_router(stats.router, prefix="/stats", tags=["stats"])
api_router.include_router(leaderboards.router, prefix="/leaderboards", tags=["leaderboards"])
api_router.include_router(hugging_face.router, prefix="/hf", tags=["hugging_face"])
api_router.include_router(admin.router, prefix="/admin", tags=["admin"])
api_router.include_router(auth.router, prefix="/auth", tags=["auth"])
+2
View File
@@ -6,7 +6,9 @@ loguru==0.6.0
numpy==1.22.4
psycopg2-binary==2.9.5
pydantic==1.9.1
pyjwt
python-dotenv==0.21.0
redis
scipy==1.8.1
SQLAlchemy==1.4.41
sqlmodel==0.0.8
+1 -1
View File
@@ -4,7 +4,7 @@ services:
# Use `docker compose up backend-dev --build --attach-dependencies` to start a database and work and the backend.
backend-dev:
image: sverrirab/sleep
depends_on: [db, adminer, redis, redis-insights]
depends_on: [db, adminer, redis, redis-insights, webdb, maildev]
# Use `docker compose up frontend-dev --build --attach-dependencies` to start all services needed to work on the frontend.
frontend-dev:
+1
View File
@@ -8,6 +8,7 @@ export DEBUG_USE_SEED_DATA=True
export DEBUG_SKIP_TOXICITY_CALCULATION=True
export DEBUG_ALLOW_SELF_LABELING=True
export DEBUG_SKIP_EMBEDDING_COMPUTATION=True
export BACKEND_CORS_ORIGINS='["http://localhost:3000"]'
uvicorn main:app --reload --port 8080 --host 0.0.0.0
@@ -148,6 +148,17 @@ export const authOptions: AuthOptions = {
}
},
},
cookies: {
sessionToken: {
name: `next-auth.session-token`,
options: {
httpOnly: true,
sameSite: "none",
path: "/",
secure: true,
},
},
},
session: {
strategy: "jwt",
},
+3
View File
@@ -7,9 +7,12 @@ import { TaskCategory } from "src/components/Tasks/TaskTypes";
import { get } from "src/lib/api";
import type { AvailableTasks, TaskType } from "src/types/Task";
export { getDefaultStaticProps as getStaticProps } from "src/lib/default_static_props";
import useSWR from "swr";
import useSWRImmutable from "swr/immutable";
const Dashboard = () => {
useSWR("http://localhost:8080/api/v1/auth/check", get);
const { data } = useSWRImmutable<AvailableTasks>("/api/available_tasks", get);
// TODO: show only these tasks: