fixes the random login on dev

This commit is contained in:
Régis Hanol 2013-03-16 00:26:32 +01:00
parent d9cdde9aa7
commit 89815878d9
2 changed files with 2 additions and 0 deletions

View File

@ -61,6 +61,7 @@ Discourse.LoginView = Discourse.ModalBodyView.extend({
$hidden_login_form.find('input[name=username]').val(_this.get('loginName')); $hidden_login_form.find('input[name=username]').val(_this.get('loginName'));
$hidden_login_form.find('input[name=password]').val(_this.get('loginPassword')); $hidden_login_form.find('input[name=password]').val(_this.get('loginPassword'));
$hidden_login_form.find('input[name=redirect]').val(window.location.href); $hidden_login_form.find('input[name=redirect]').val(window.location.href);
$hidden_login_form.find('input[name=authenticity_token]').val($('meta[name=csrf-token]').attr('content'));
$hidden_login_form.submit(); $hidden_login_form.submit();
} }
}).fail(function(result) { }).fail(function(result) {

View File

@ -26,6 +26,7 @@
<input name="username" type="text" id="signin_username"> <input name="username" type="text" id="signin_username">
<input name="password" type="password" id="signin_password"> <input name="password" type="password" id="signin_password">
<input name="redirect" type="hidden"> <input name="redirect" type="hidden">
<input name="authenticity_token" type="hidden" />
<input type="submit" id="signin-button" value="Log In"> <input type="submit" id="signin-button" value="Log In">
</form> </form>
<% end %> <% end %>