forked from nadvolod/cypress-example-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.hbs
63 lines (59 loc) · 1.18 KB
/
login.hbs
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
<!DOCTYPE html>
<html>
<head>
<title>Logging In - CSRF Tokens - Login</title>
<style type="text/css">
body {
padding: 0 10px;
}
#form-wrapper {
padding: 10px 20px;
background-color: #eee;
}
ul {
list-style-type: none;
}
li {
margin: 10px 0;
}
.error {
color: red;
font-weight: bold;
}
</style>
</head>
<body>
<h2>login.html</h2>
<p>
This example has a regular HTML form that POSTs username, password and csrf token to the node server.
</p>
<p>
In this recipe we are going to show how to bypass and manage CSRF tokens.
</p>
<div id="form-wrapper">
<form method="POST" action="/login">
<ul>
<li>
<label>
Username:
<input name="username" />
</label>
</li>
<li>
<label>
Password:
<input name="password" />
</label>
</li>
<li>
<button type="submit">Submit</button>
</li>
</ul>
<input type="hidden" name="_csrf" value={{csrfToken}} />
</form>
{{#if error}}
<p class="error">{{error}}</p>
{{/if}}
</div>
</body>
</html>