Procházet zdrojové kódy

Fixed redirect after registration.

tags/3.0.0^2
Teknikode před 8 měsíci
rodič
revize
f7b3857427

+ 3
- 1
Teknik/Areas/User/Controllers/UserController.cs Zobrazit soubor

@@ -165,7 +165,9 @@ namespace Teknik.Areas.Users.Controllers
}
if (!model.Error)
{
return Redirect(Url.SubRouteUrl("account", "User.Login", new { returnUrl = model.ReturnUrl }));
// Let's log them in

return GenerateActionResult(new { success = true, redirectUrl = Url.SubRouteUrl("account", "User.Login", new { returnUrl = model.ReturnUrl }) }, Redirect(Url.SubRouteUrl("account", "User.Login", new { returnUrl = model.ReturnUrl })));
}
}
}

+ 8
- 3
Teknik/Scripts/common.js Zobrazit soubor

@@ -21,7 +21,7 @@ $(document).ready(function () {
$("#registerStatus").html('');

// Disable the register button
disableButton('#registerSubmit', 'Signing In...');
disableButton('#registerSubmit', 'Signing Up...');

var form = $('#registrationForm');
$.ajax({
@@ -33,8 +33,13 @@ $(document).ready(function () {
withCredentials: true
},
success: function (html) {
if (html.result) {
window.location.reload();
if (html.success) {
$('#registerModal').modal('hide');

$("#top_msg").css('display', 'inline', 'important');
$("#top_msg").html('<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>Registration Successful. Redirecting...</div>');

window.location = html.redirectUrl;
}
else {
$("#registerStatus").css('display', 'inline', 'important');

Načítá se…
Zrušit
Uložit