index.html 2.99 KB
Newer Older
KangMin An's avatar
KangMin An committed
1
2
<!DOCTYPE html>
<html lang="en">
Spark's avatar
layouut    
Spark committed
3
4
5
6
7
8
9

<head>
  <meta charset="utf-8" />
  <link rel="icon" href="%PUBLIC_URL%/images/logoeue.png" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta name="theme-color" content="#000000" />
  <meta name="description" content="Web site created using create-react-app" />
10
  <link rel="apple-touch-icon" href="%PUBLIC_URL%/images/Kakao.png" />
Spark's avatar
layouut    
Spark committed
11
  <!--
KangMin An's avatar
KangMin An committed
12
13
14
      manifest.json provides metadata used when your web app is installed on a
      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
    -->
Spark's avatar
layouut    
Spark committed
15
16
  <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
  <!--
KangMin An's avatar
KangMin An committed
17
18
19
20
21
22
23
24
      Notice the use of %PUBLIC_URL% in the tags above.
      It will be replaced with the URL of the `public` folder during the build.
      Only files inside the `public` folder can be referenced from the HTML.

      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
      work correctly both with client-side routing and a non-root public URL.
      Learn how to configure a non-root public URL by running `npm run build`.
    -->
Spark's avatar
layouut    
Spark committed
25
  <title>EUE, make your day</title>
Spark's avatar
Spark committed
26
  <script src='https://developers.kakao.com/sdk/js/kakao.min.js'></script>
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
  <script>
    Kakao.init("29c2c90caed30db77d55580048c53d7b");
    Kakao.isInitialized();
    console.log(Kakao.isInitialized());

    function loginWithKakao() {
      Kakao.Auth.authorize({
        redirectUri: 'http://localhost:3000/oauth'
      })
    }
    // 아래는 데모를 위한 UI 코드입니다.
    displayToken()
    function displayToken() {
      const token = getCookie('authorize-access-token')
      if (token) {
        Kakao.Auth.setAccessToken(token)
        Kakao.Auth.getStatusInfo(({ status }) => {
          if (status === 'connected') {
            document.getElementById('token-result').innerText = 'login success. token: ' + Kakao.Auth.getAccessToken()
          } else {
            Kakao.Auth.setAccessToken(null)
          }
        })
      }
    }
    function getCookie(name) {
      const value = "; " + document.cookie;
      const parts = value.split("; " + name + "=");
      if (parts.length === 2) return parts.pop().split(";").shift();
    }
  </script>
  <script type="text/javascript">
    function loginWithKakaoPOP() {
      Kakao.Auth.login({
        success: function (authObj) {
          alert(JSON.stringify(authObj))
        },
        fail: function (err) {
          alert(JSON.stringify(err))
        },
      })
    }
  </script>
Spark's avatar
layouut    
Spark committed
70
71
72
73
74
75
</head>

<body>
  <noscript>You need to enable JavaScript to run this app.</noscript>
  <div id="root"></div>
  <!--
KangMin An's avatar
KangMin An committed
76
77
78
79
80
81
82
83
84
      This HTML file is a template.
      If you open it directly in the browser, you will see an empty page.

      You can add webfonts, meta tags, or analytics to this file.
      The build step will place the bundled scripts into the <body> tag.

      To begin the development, run `npm start` or `yarn start`.
      To create a production bundle, use `npm run build` or `yarn build`.
    -->
Spark's avatar
layouut    
Spark committed
85
86
87
</body>

</html>