1
0
Fork 0

Add CSRF tokens to forms

This commit is contained in:
Alex Kotov 2020-10-17 01:17:31 +05:00
parent dde9d9ce15
commit becdbf38ed
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
3 changed files with 7 additions and 1 deletions

View file

@ -32,7 +32,9 @@
<div class="dropdown-menu" aria-labelledby="currentUserNavbarDropdown">
<form method="post" action="/sign_out">
<input name="_method" type="hidden" value="delete">
<input type="hidden" name="_method" value="delete"/>
<input type="hidden" name="authenticity_token" value="{{ csrf_token }}"/>
<button type="submit" class="dropdown-item">
Sign Out
</button>

View file

@ -3,6 +3,8 @@
<h1>Sign In</h1>
<form method="post" action="/sign_in">
<input type="hidden" name="authenticity_token" value="{{ csrf_token }}"/>
<div class="form-group">
<label for="username">Username</label>
<input id="username" name="username" type="text" class="form-control" placeholder="Username"/>

View file

@ -3,6 +3,8 @@
<h1>Sign Up</h1>
<form method="post" action="/sign_up">
<input type="hidden" name="authenticity_token" value="{{ csrf_token }}"/>
<div class="form-group">
<label for="username">Username</label>
<input id="username" name="username" type="text" class="form-control" placeholder="Username"/>