mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-12-01 21:33:45 +03:00
40 lines
1.1 KiB
HTML
40 lines
1.1 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
|
|
<div class="row">
|
|
<div class="form-group">
|
|
<label for="token" class="col-sm-2 control-label">User Token</label>
|
|
<div class="col-sm-4">
|
|
<input name="token" type="text" class="form-control" id="token" placeholder="Token">
|
|
<p class="help-block">Token received after login</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<h3>Update User Details</h3><hr/>
|
|
{% include "fragments/password_change_form.html" %}
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block script %}
|
|
<script type="text/javascript">
|
|
$().ready(function(){
|
|
$('form button[type=submit]').click(function(){
|
|
var token = $('input[name=token]').val();
|
|
var form = $('form');
|
|
$.ajax({
|
|
url: form.attr('action'),
|
|
data: $('form').serialize(),
|
|
type: "POST",
|
|
beforeSend: function(xhr){xhr.setRequestHeader('Authorization', 'Token '+token);}
|
|
}).fail(function(data){error_response(data);})
|
|
.done(function(data){susccess_response(data);});
|
|
return false;
|
|
});
|
|
|
|
});
|
|
</script>
|
|
{% endblock %}
|