login.ejs 1.11 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>logined</title>
</head>
<body>

<h1>Hi <%= user.name %></h1>
<form method="post">
    NickName:<br>
    <input type="text" name="nickname" value="MickeyMouse"><br>
    Age:<br>
    <input type="text" name="age" value="19"><br><br>

    <input type="radio" id="male" name="gender" value="male">
    <label for="male">Male</label><br>
    <input type="radio" id="female" name="gender" value="female">
    <label for="female">Female</label><br>

    <input type="submit" value="Submit">
</form>
<a href="/logout" onclick="signOut();">Sign Out</a>
<%if (message=='same nickname'){%>
    <script type="text/javascript">

        alert("입력하신 NICKNAME은 사용하지 못합니다." +
            "다른 NICKNAME을 입력하여 주세요");

    </script>
<%}%>

</body>
<script>
    function signOut() {
        var auth2 = gapi.auth2.getAuthInstance();
        auth2.signOut().then(function () {
            console.log('User signed out.');
        });
    }
</script>
</html>