Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#514] 로그인 redirect uri 수정 #515

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/apis/core/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import webStorage from '@/utils/storage';

const storage = webStorage(ACCESS_TOKEN_STORAGE_KEY);
const options: CreateAxiosDefaults = {
baseURL: process.env.NEXT_HOST,
baseURL: process.env.NEXT_PUBLIC_HOST,
headers: {
Accept: '*/*',
'Content-Type': 'application/json',
Expand Down
5 changes: 2 additions & 3 deletions src/app/bookshelf/[bookshelfId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import LikeButton from '@/v1/base/LikeButton';
import BackButton from '@/v1/base/BackButton';
import ShareButton from '@/v1/base/ShareButton';
import type { APIBookshelf, APIBookshelfInfo } from '@/types/bookshelf';

const KAKAO_OAUTH_LOGIN_URL = `${process.env.NEXT_PUBLIC_API_URL}/oauth2/authorize/kakao?redirect_uri=${process.env.NEXT_PUBLIC_CLIENT_REDIRECT_URI}`;
import { KAKAO_LOGIN_URL } from '@/constants/url';

export default function UserBookShelfPage({
params: { bookshelfId },
Expand Down Expand Up @@ -134,7 +133,7 @@ const BookShelfContent = ({
<br />
인사이트를 얻을 수 있어요.
</p>
<Link href={KAKAO_OAUTH_LOGIN_URL}>
<Link href={KAKAO_LOGIN_URL}>
<Button colorScheme="kakao" size="full">
<div className="flex justify-center gap-[1rem]">
<IconKakao width={16} height={'auto'} />
Expand Down
4 changes: 2 additions & 2 deletions src/app/profile/me/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { IconArrowRight } from '@public/icons';

import SSRSafeSuspense from '@/components/SSRSafeSuspense';

import { KAKAO_LOGIN_URL } from '@/constants/url';
import userKeys from '@/queries/user/key';
import Avatar from '@/v1/base/Avatar';
import Button from '@/v1/base/Button';
import Loading from '@/v1/base/Loading';
Expand All @@ -20,11 +22,9 @@ import BookShelf from '@/v1/bookShelf/BookShelf';
import ProfileBookShelf from '@/v1/profile/bookShelf/ProfileBookShelf';
import ProfileGroup from '@/v1/profile/group/ProfileGroup';
import ProfileInfo from '@/v1/profile/info/ProfileInfo';
import userKeys from '@/queries/user/key';
import { useQueryClient } from '@tanstack/react-query';

const USER_ID = 'me';
const KAKAO_LOGIN_URL = `${process.env.NEXT_PUBLIC_API_URL}/oauth2/authorize/kakao?redirect_uri=${process.env.NEXT_PUBLIC_CLIENT_REDIRECT_URI}`;

const MyProfilePage = () => {
const isAuthenticated = checkAuthentication();
Expand Down
3 changes: 2 additions & 1 deletion src/constants/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export const DATA_URL = {
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjWL9+/X8ABysDDapsaG4AAAAASUVORK5CYII=', // data url for placeholder color (#AFAFAF)
};

export const KAKAO_LOGIN_URL = `${process.env.NEXT_PUBLIC_API_URL}/oauth2/authorize/kakao?redirect_uri=${process.env.NEXT_PUBLIC_CLIENT_REDIRECT_URI}`;
const LOGIN_REDIRECT_URI = `${process.env.NEXT_PUBLIC_HOST}/login/redirect`;
export const KAKAO_LOGIN_URL = `${process.env.NEXT_PUBLIC_API_URL}/oauth2/authorize/kakao?redirect_uri=${LOGIN_REDIRECT_URI}`;
Loading