Skip to content

Commit

Permalink
fix: 헤더 로고 클릭 동선 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
miro-ring committed Feb 21, 2024
1 parent 5e1f243 commit 3b4a8c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Create and publish a Docker image to AWS ECR ans deploy to EC2
on:
push:
branches:
- main
- bug/BAR-248

env:
REGISTRY: ${{ secrets.AWS_ECR_REGISTRY }}
Expand Down
7 changes: 5 additions & 2 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import type { NextRequest } from 'next/server';
import { NextResponse } from 'next/server';

import { STORAGE_KEY } from '@models/storage';

export const middleware = async (request: NextRequest) => {
const refreshToken = request.cookies.get('refreshToken');
const refreshToken = request.cookies.get(STORAGE_KEY.REFRESH_TOKEN);

if (request.nextUrl.pathname.startsWith('/terms')) return;

if (refreshToken && request.nextUrl.pathname === '/') {
if (refreshToken?.value && request.nextUrl.pathname === '/') {
return NextResponse.redirect(new URL('/main', request.url));
}

if (
!refreshToken &&
request.nextUrl.pathname !== '/' &&
Expand Down

0 comments on commit 3b4a8c3

Please sign in to comment.