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:
parent
bed3d95d9e
commit
f7b3857427
@ -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 })));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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">×</button>Registration Successful. Redirecting...</div>');
|
||||
|
||||
window.location = html.redirectUrl;
|
||||
}
|
||||
else {
|
||||
$("#registerStatus").css('display', 'inline', 'important');
|
||||
|
Loading…
Reference in New Issue
Block a user