Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
parsa-asgari committed Apr 1, 2024
1 parent 1483898 commit b564722
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
- "traefik.http.routers.front-${PROJECT_NAME}.tls=true"
- "traefik.http.routers.front-${PROJECT_NAME}.tls.domains[0].main=${SITE_URL}"
- "traefik.http.routers.front-${PROJECT_NAME}.tls.certresolver=myresolver"
- "traefik.docker.network=local-traefik-network"
networks:
- local-traefik-network

Expand All @@ -41,6 +42,7 @@ services:
- "traefik.http.routers.nginx-${PROJECT_NAME}.tls=true"
- "traefik.http.routers.nginx-${PROJECT_NAME}.tls.domains[0].main=${SITE_URL}"
- "traefik.http.routers.nginx-${PROJECT_NAME}.tls.certresolver=myresolver"
- "traefik.docker.network=local-traefik-network"
networks:
- local-traefik-network

Expand Down
9 changes: 9 additions & 0 deletions middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@ export async function middleware(request: NextRequest) {
)
// console.log(await supabase.auth.getUser())
let {data: session} = await supabase.auth.getSession()
const SUPABASE_ID = process.env.NEXT_PUBLIC_SUPABASE_URL!.split('//')[1].split('.')[0]
const sessionCookies = {
name: `sb-${SUPABASE_ID}-auth-token`,
value: JSON.stringify(session),
path: '/',
expires: new Date(new Date().getTime() + 60 * 60 * 1000 * 24 * 365), // 1 year,
};

response.cookies.set(sessionCookies)
await supabase.auth.getUser()
const cookieStore = cookies()

Expand Down

0 comments on commit b564722

Please sign in to comment.