1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Fixed redirect after registration.

This commit is contained in:
Uncled1023 2019-01-26 00:11:27 -08:00
parent bed3d95d9e
commit f7b3857427
2 changed files with 11 additions and 4 deletions

View File

@ -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 })));
}
}
}

View File

@ -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');