forked from DhananjayPurohit/ISO-12-E1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.html
64 lines (59 loc) · 2.11 KB
/
login.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.1/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.1/js/materialize.min.js"></script>
<h4 align='center' style="margin-top:75; margin-bottom:15">Login</h4>
<h6 align='center' style="color: #d3d3d3;; margin-bottom: 30;">The Classic Way!</h6>
<div id="user-login" class="row" style="max-width:750">
<div class="col s12 z-depth-6 card-panel">
<form class="login-form" method="post">
<div class="row margin">
<div class="input-field col s12">
<i class="mdi-social-person-outline prefix"></i>
<input class="validate" id="user_email" type="email" placeholder="Username">
</div>
</div>
<div class="row margin">
<div class="input-field col s12">
<i class="mdi-action-lock-outline prefix"></i>
<input id="user_pass" placeholder="Password" type="password">
</div>
</div>
<div class="row">
<div class="input-field col s12">
<a class="btn waves-effect waves-light col s12" onclick="onButtonClick()">Login</a>
</div>
</div>
<h6 style="margin-top:30;" align='center'>New Here? <a href='./register.html'>Register here</a></h6>
</form>
</div>
</div>
<script>
function onButtonClick(){
// var myHeaders = new Headers();
// myHeaders.append("Content-Type", "application/json; charset=UTF-8");
var myHeaders = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
//
// var formdata = new FormData();
// formdata.append("username", "vedangj");
// formdata.append("password", "pass123");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body:JSON.stringify({
username:"vedangj",
password:"pass123"
}),
redirect: 'follow'
};
fetch("http://127.0.0.1:5000/login", requestOptions)
.then(response => response.text())
.then(result => document.cookie = "subjects="+result)
.catch(error => console.log('error', error));
}
</script>