-
Notifications
You must be signed in to change notification settings - Fork 1
[feat] add login functionality #9
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
dc12248
feat:add login functionality
naseungyeop a64ec3a
Merge branch '8-add-login-functionality' of https://github.com/najitwโฆ
naseungyeop edec024
refactor: Update login functionality
naseungyeop ca90427
:sparkles: feat: add zustand store and fix login functionality
naseungyeop 8f7a54c
:bug: fix: linting issues
naseungyeop 4371164
:bug: refactor: refactor update types in zustand store
naseungyeop 7e77ff8
:bug: refactor: update types in zustand store2
naseungyeop 11eac31
Merge branch 'develop' of https://github.com/najitwo/10-Sprint-Taskifโฆ
naseungyeop 31e54f9
:recycle: refactor: authStore for token handling
naseungyeop 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 hidden or 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,15 @@ | ||
| import axios from 'axios'; | ||
| import { AUTH_URL } from '@/constants/urls'; | ||
|
|
||
| export default async function handleLogin(email: string, password: string) { | ||
| try { | ||
| const response = await axios.post(`${AUTH_URL}/login`, { email, password }); | ||
| const { accessToken } = response.data; | ||
|
|
||
| localStorage.setItem('accessToken', accessToken); | ||
| return true; | ||
| } catch (error) { | ||
| console.error('๋ก๊ทธ์ธ ์คํจ:', error); | ||
| return false; | ||
| } | ||
| } | ||
Empty file.
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.
๋ก์ปฌ์คํ ๋ฆฌ์ง๋ฅผ ์ฌ์ฉํ์ จ๋๋ฐ ์ ์ฌ์ฉํ์ จ๋์?
๋ก๊ทธ์ธ์์ฒญํ ์๋ต ๋ฐ์๋ accessToken์ด ์ด๋์ ์ ์ฅ๋๋์ง ํ์ธํ์ จ๋์?
์ ํฌ ์ ์ญ ์ํ ๊ด๋ฆฌ๋ zustand ์ฌ์ฉํ๊ธฐ๋ก ํ์ผ๋ zustand๋ก ๊ด๋ฆฌํ๋ ๊ฒ์ ์ถ์ฒ๋๋ ค์.
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.
zustand๋ฅผ ์ฌ์ฉํด์ ๋ค์ ์์ ํ๊ฒ์ต๋๋ค