Skip to content

Commit b5e0116

Browse files
committed
[#56] 💄 format all files
1 parent a578dc3 commit b5e0116

File tree

8 files changed

+5956
-2133
lines changed

8 files changed

+5956
-2133
lines changed

.github/workflows/git-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
user-email: ${{ secrets.OFFICIAL_ACCOUNT_EMAIL }}
3333
commit-message: ${{ github.event.head_commit.message || 'Auto-deployed from GitHub Actions' }}
3434
target-branch: dev
35-
push-args: --force # 강제 푸시 옵션 추가
35+
push-args: --force # 강제 푸시 옵션 추가
3636

3737
- name: Test Get Variable Exported by Push-to-Another-Repository
3838
run: echo $DESTINATION_CLONED_DIRECTORY

pnpm-lock.yaml

Lines changed: 5895 additions & 2073 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/(pages)/sign-in/page.tsx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
'use client'
22

3+
import { useRouter } from 'next/navigation'
4+
35
import React from 'react'
46
import { SubmitHandler, useForm } from 'react-hook-form'
5-
import { SignInRequest, SignInResponse } from '@/types/auth.types'
6-
import {useRouter} from 'next/navigation'
77

8+
import { SignInRequest, SignInResponse } from '@/types/auth.types'
89

910
export default function LoginPage(): JSX.Element {
1011
const {
@@ -13,30 +14,29 @@ export default function LoginPage(): JSX.Element {
1314
formState: { errors },
1415
} = useForm<SignInRequest>()
1516

16-
17-
const onSubmit: SubmitHandler<SignInRequest> = async (data) => {
17+
const onSubmit: SubmitHandler<SignInRequest> = async data => {
1818
try {
19-
const response = await fetch(`/api/auth/sign-in`, {
20-
method: 'POST',
21-
headers: {'Content-Type': 'application/json'},
22-
body: JSON.stringify(data),
23-
})
19+
const response = await fetch(`/api/auth/sign-in`, {
20+
method: 'POST',
21+
headers: { 'Content-Type': 'application/json' },
22+
body: JSON.stringify(data),
23+
})
2424

25-
if (!response.ok){
26-
console.error('Login failed')
27-
alert('로그인 실패 프록시 전달')
28-
return
29-
}
25+
if (!response.ok) {
26+
console.error('Login failed')
27+
alert('로그인 실패 프록시 전달')
28+
return
29+
}
3030

31-
const result= await response.json()
32-
console.log('Login successful:', result)
33-
alert('로그인 성공')
34-
}catch (error) {
35-
console.error('Login error', error)
36-
alert('로그인 요청 중 오류 발생')
37-
}
31+
const result = await response.json()
32+
console.log('Login successful:', result)
33+
alert('로그인 성공')
34+
} catch (error) {
35+
console.error('Login error', error)
36+
alert('로그인 요청 중 오류 발생')
37+
}
3838
}
39-
39+
4040
return (
4141
<div>
4242
<h1>로그인</h1>

src/app/api/auth/sign-in/route.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,40 @@
1-
import { NextResponse } from 'next/server';
1+
import { NextResponse } from 'next/server'
22

33
export const POST = async (req: Request): Promise<NextResponse> => {
4-
const { email, password } = await req.json();
4+
const { email, password } = await req.json()
55
const response = await fetch('http://43.202.50.174:8080/v1/auth/sign-in', {
66
headers: { 'Content-Type': 'application/json' },
77
method: 'POST',
88
body: JSON.stringify({ email, password }),
9-
});
9+
})
1010

1111
if (!response.ok) {
1212
return NextResponse.json(
1313
{ error: 'Login failed' },
14-
{ status: response.status }
15-
);
14+
{ status: response.status }
15+
)
1616
}
1717

18-
const data = await response.json();
19-
const { accessToken, refreshToken } = data.result;
18+
const data = await response.json()
19+
const { accessToken, refreshToken } = data.result
2020

21-
const res = NextResponse.json({ success: true });
21+
const res = NextResponse.json({ success: true })
2222

23-
2423
res.cookies.set('accessToken', accessToken, {
2524
httpOnly: true,
2625
secure: true,
2726
sameSite: 'strict',
2827
path: '/',
2928
maxAge: 3600,
30-
});
31-
29+
})
3230

3331
res.cookies.set('refreshToken', refreshToken, {
3432
httpOnly: true,
3533
secure: true,
3634
sameSite: 'strict',
3735
path: '/',
3836
maxAge: 86400,
39-
});
37+
})
4038

41-
return res;
42-
};
39+
return res
40+
}

src/app/api/auth/sign-out/route.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
import { NextResponse } from 'next/server';
1+
import { NextResponse } from 'next/server'
22

33
export const POST = async (): Promise<NextResponse> => {
44
try {
5-
const res = NextResponse.json({ success: true, message: '로그아웃 성공' });
5+
const res = NextResponse.json({ success: true, message: '로그아웃 성공' })
66

77
res.cookies.set('accessToken', '', {
88
httpOnly: true,
99
secure: true,
1010
sameSite: 'strict',
1111
path: '/',
12-
maxAge: 0,
13-
});
12+
maxAge: 0,
13+
})
1414

1515
res.cookies.set('refreshToken', '', {
1616
httpOnly: true,
1717
secure: true,
1818
sameSite: 'strict',
1919
path: '/',
20-
maxAge: 0,
21-
});
20+
maxAge: 0,
21+
})
2222

23-
return res;
23+
return res
2424
} catch (error: any) {
25-
console.error('로그아웃 처리 중 오류 발생:', error);
25+
console.error('로그아웃 처리 중 오류 발생:', error)
2626
return NextResponse.json(
2727
{ success: false, message: '서버 오류로 로그아웃 실패' },
2828
{ status: 500 }
29-
);
29+
)
3030
}
31-
};
31+
}

src/app/page.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@
33
import { useRouter } from 'next/navigation'
44

55
import axios from 'axios'
6-
import { signOut } from '@/services/auth/auth'
6+
77
import { useAuthStore } from '@/stores/useAuthStore'
88

9+
import { signOut } from '@/services/auth/auth'
10+
911
export default function Home(): JSX.Element {
1012
const { logout } = useAuthStore()
1113

1214
const router = useRouter()
1315

1416
const handleLogout = async () => {
1517
try {
16-
const response = await fetch(`/api/auth/sign-out`,{
18+
const response = await fetch(`/api/auth/sign-out`, {
1719
method: 'POST',
18-
headers: {'Content-Type': 'application/json'},
20+
headers: { 'Content-Type': 'application/json' },
1921
})
20-
if (!response.ok){
22+
if (!response.ok) {
2123
const errorResult = await response.json()
2224
console.error('Logout failed')
2325
alert('로그아웃 실패 프록시')
@@ -26,7 +28,7 @@ export default function Home(): JSX.Element {
2628
console.log('Logout successful')
2729
alert('로그아웃 성공 프록시')
2830
router.push('/sign-in')
29-
} catch(error){
31+
} catch (error) {
3032
console.error('Logout error', error)
3133
alert('로그아웃 요청 중 오류 발생')
3234
}

src/services/auth/auth.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ const apiClient = axios.create({
1313
// withCredentials: true,
1414
})
1515

16-
17-
export const signIn = async (data: SignInRequest): Promise<AxiosResponse<SignInResponse>> => {
16+
export const signIn = async (
17+
data: SignInRequest
18+
): Promise<AxiosResponse<SignInResponse>> => {
1819
return await apiClient.post<SignInResponse>('/v1/auth/sign-in', data, {
19-
// withCredentials: true, //
20-
});
21-
};
20+
// withCredentials: true, //
21+
})
22+
}
2223

23-
export const signOut = async () =>{
24+
export const signOut = async () => {
2425
return await axios.post('/v1/auth/logout', {}, { withCredentials: true })
25-
}
26+
}

src/styles/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ input[type='radio']:checked + .custom-radio::before {
3535

3636
label:focus-within .custom-radio {
3737
@apply ring-1 ring-primary-normal;
38-
}
38+
}

0 commit comments

Comments
 (0)