박권수

feat. kakao register / login

...@@ -319,12 +319,19 @@ exports.socialRegister = async ctx => { ...@@ -319,12 +319,19 @@ exports.socialRegister = async ctx => {
319 const result = await axios.get(url, { 319 const result = await axios.get(url, {
320 headers : { 320 headers : {
321 Authorization : `Bearer ${accessToken}`, 321 Authorization : `Bearer ${accessToken}`,
322 + 'Content-type' : 'application/x-www-form-urlencoded;charset=utf-8',
322 }, 323 },
323 }); 324 });
324 325
325 - console.log(result); 326 + const { email, profile } = result.data.kakao_account;
327 +
328 + return {
329 + userId : email,
330 + userNm : profile.nickname,
331 + contact : `${email}_등록되지않은 번호`,
332 + birth : '등록되지않음',
333 + };
326 334
327 - return result;
328 } : () => null; 335 } : () => null;
329 336
330 337
...@@ -411,12 +418,11 @@ exports.socialLogin = async ctx => { ...@@ -411,12 +418,11 @@ exports.socialLogin = async ctx => {
411 const result = await axios.get(url, { 418 const result = await axios.get(url, {
412 headers : { 419 headers : {
413 Authorization : `Bearer ${accessToken}`, 420 Authorization : `Bearer ${accessToken}`,
421 + 'Content-type' : 'application/x-www-form-urlencoded;charset=utf-8',
414 }, 422 },
415 }); 423 });
416 424
417 - console.log(result); 425 + return result.data.kakao_account.email;
418 -
419 - return result;
420 } : () => null; 426 } : () => null;
421 427
422 428
......