-
Notifications
You must be signed in to change notification settings - Fork 0
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
[ORT-2] feat: add KakaoLoginButton #2
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e3a2327
[ORT-2] feat: add KakaoLoginButton
crew852 b6fe479
Update oauth.kakao.tsx.tsx
crew852 9488104
feat: add package - axois, uuid
crew852 e91bc63
feat: edit uuid parse for cloudflare
crew852 49d03a1
feat: uuid utilize, comment to js doc, action to loader function
crew852 62e4927
feat: delete useless part
crew852 e0c2842
Update app/utils/getUUID.ts
crew852 505907d
feat: fix package, util name
crew852 ed6b270
Merge branch 'ORT-2_add-KakaoLoginButton' of https://github.com/major…
crew852 dd22322
fix: apply changed util func name, fix export default to named export
crew852 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React, { useMemo } from 'react'; | ||
import { getUUID } from '@/utils/random'; | ||
|
||
const clientId = 'f5aa2f20e42d783654b8e8c01bfc6312'; | ||
//redirectUri는 등록된 redirectUri중에 임의로 사용했습니다. | ||
const redirectUri = 'http://localhost:5173/oauth/kakao'; | ||
|
||
const KakaoLoginButton: React.FC = () => { | ||
const kakaoAuthUrl = useMemo(() => { | ||
const userUUID = getUUID(); | ||
return `https://kauth.kakao.com/oauth/authorize?client_id=${clientId}&redirect_uri=${redirectUri}&response_type=code&state=${userUUID}`; | ||
}, []); | ||
|
||
return ( | ||
<a href={kakaoAuthUrl}> | ||
<button>카카오로 로그인</button> | ||
</a> | ||
); | ||
}; | ||
|
||
export default KakaoLoginButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import KakaoLoginButton from './KakaoLoginButton'; | ||
|
||
export default KakaoLoginButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { LoaderFunction, json } from '@remix-run/cloudflare'; | ||
|
||
export const loader: LoaderFunction = async ({ request }) => { | ||
const url = new URL(request.url); | ||
const code = url.searchParams.get('code'); | ||
const state = url.searchParams.get('state'); | ||
|
||
// 이 아래의 try문 지우고 이어서 하면 됩니다 | ||
try { | ||
console.log(code, state); | ||
} catch { | ||
console.log(json); | ||
} | ||
}; | ||
|
||
const KakaoRedirect = () => <div>카카오 로그인 중...</div>; | ||
|
||
export default KakaoRedirect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { v4 as uuidv4 } from 'uuid'; | ||
|
||
//이용자의 uuid를 받아옵니다. | ||
export const getUUID = () => uuidv4(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
우선은 상관없지만, 제가 Env 관련 작업을 하고 나면 환경변수로 변경하면 좋을 듯합니다!