Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-2_open_source_sw_development_Han
/
Jaksimsamil
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
JaeHyeok Song
2020-12-04 21:49:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
140ddb0fb12609699b806d31b07ac60848324c44
140ddb0f
1 parent
7dcdb7d9
add kakao login
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
0 deletions
jaksimsamil-page/public/index.html
jaksimsamil-page/src/components/setting/KakaoLogin.js
jaksimsamil-page/src/components/setting/SettingForm.js
jaksimsamil-page/public/index.html
View file @
140ddb0
...
...
@@ -25,6 +25,8 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>
React App
</title>
<script>
"https://developers.kakao.com/sdk/ks/kakao.min.js"
</script>
<script>
Kakao
.
init
(
"9454fd9d91effc97b064c201f04586d2"
);
</script>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
...
...
jaksimsamil-page/src/components/setting/KakaoLogin.js
0 → 100644
View file @
140ddb0
import
{
makeStyles
}
from
'@material-ui/core/styles'
;
import
TextField
from
'@material-ui/core/TextField'
;
import
React
from
'react'
;
import
path
from
'path'
;
require
(
"dotenv"
).
config
({
path
:
path
.
join
(
__dirname
,
'/jaksimsamil-server/.env'
)
});
console
.
log
(
process
.
env
.
KAKAO_JS_KEY
);
const
useStyles
=
makeStyles
((
theme
)
=>
({
root
:
{
'& > *'
:
{
margin
:
theme
.
spacing
(
1
),
},
},
button
:
{
margin
:
theme
.
spacing
(
1
),
},
}));
const
KakaoLoginBtn
=
()
=>
{
const
classes
=
useStyles
();
const
kakaoLogin
=
function
()
{
window
.
Kakao
.
Auth
.
login
({
success
:
function
(
auth
)
{
console
.
log
(
auth
);
},
fail
:
function
(
err
)
{
console
.
log
(
err
);
}
})
}
return
(
<
div
>
<
button
onClick
=
{
kakaoLogin
}
>
KakaoLogin
<
/button
>
<
/div
>
);
};
export
default
KakaoLoginBtn
\ No newline at end of file
jaksimsamil-page/src/components/setting/SettingForm.js
View file @
140ddb0
...
...
@@ -8,6 +8,7 @@ import Paper from '@material-ui/core/Paper';
import
Grid
from
'@material-ui/core/Grid'
;
import
CircularProgress
from
'@material-ui/core/CircularProgress'
;
import
styled
from
'styled-components'
;
import
KakaoLoginBtn
from
'./KakaoLogin'
const
useStyles
=
makeStyles
((
theme
)
=>
({
root
:
{
...
...
@@ -80,6 +81,17 @@ const SettingForm = ({
/
>
<
/Paper
>
<
/Grid
>
<
Grid
container
item
xs
=
{
6
}
>
<
Paper
className
=
{
classes
.
paper
}
elevation
=
{
3
}
>
<
h1
>
카카오
로그인
<
/h1
>
<
KakaoLoginBtn
profile
=
{
profile
}
onChange
=
{
onChange
}
/
>
<
/Paper
>
<
/Grid
>
<
/Grid
>
<
/div
>
);
...
...
Please
register
or
login
to post a comment