Browse Source

added redirect_to field to login form

Rafał Pitoń 10 years ago
parent
commit
538609d974

+ 1 - 0
misago/emberapp/app/controllers/login-modal.js

@@ -63,6 +63,7 @@ export default Ember.Controller.extend({
 
   logIn: function(credentials) {
     var $form = Ember.$('#hidden-login-form');
+    $form.find('input[name=redirect_to]').val(window.location.href);
     $form.find('input[name=username]').val(credentials.username);
     $form.find('input[name=password]').val(credentials.password);
     $form.submit();

+ 1 - 0
misago/emberapp/app/index.html

@@ -21,6 +21,7 @@
 
     <form id='hidden-login-form' method="post" action="/login/" style="display: none;">
       <input name="csrfmiddlewaretoken" type="text" value="">
+      <input name="redirect_to" type="text">
       <input name="username" type="text">
       <input name="password" type="password">
       <input type="submit" id="signin-button" value="Sign in">

+ 1 - 0
misago/templates/misago/auth.html

@@ -2,6 +2,7 @@
 {% if user.is_anonymous %}
 <form id='hidden-login-form' method="post" action="{% url LOGIN_URL %}" style="display: none;">
   {% csrf_token %}
+  <input name="redirect_to" type="text">
   <input name="username" type="text">
   <input name="password" type="password">
   <input type="submit" id="signin-button" value="{% trans "Sign in" %}">