And the user is not redirected to the backoffice. If the page is reloaded manually (F5) the backoffice appear as expected, means that the cookie is set correctly.
I think this means angularJs does not have a built in function for $scope.submit anymore, but not sure.
I have been working on a 2fa package for Umbraco 8 that will we released later this week or next week and I solved this by using a different function to refresh the page.
I hardcoded the backoffice URL and allowed that URL to be changed in a constants file. If you swap $scope.submit for this line it should work:
$window.location.href = '/umbraco';
For this to work you will have to inject $window in your controller like you did with $scope and authResource.
If you have a different backoffice URL you should ofcourse put that in the string instead of /umbraco
Thanks for the reply, that's how i solved it as well, bad thing about this is if your automatically logged out from Umbraco all your changes will be gone because of the redirect.
It's not my favorite solution either, but it's the only one I could get to work. Normally i use a different method in the angular controllers to refresh the page:$route.reload().
But when i use that method in the login controler it updates the URL but it doesn't refresh the view so for now this seems to be the only way
2FA - Umbraco 8 - Redirect to backoffice after successful code
Howdy!
We have two factor authentication enabled for our Umbraco site, in Umbraco 7 we used this code snippet to verify the 2fa code:
Now the $scope.submit(true) throws a error:
And the user is not redirected to the backoffice. If the page is reloaded manually (F5) the backoffice appear as expected, means that the cookie is set correctly.
Any ideas how to solve this?
/ Herman
I think this means angularJs does not have a built in function for $scope.submit anymore, but not sure.
I have been working on a 2fa package for Umbraco 8 that will we released later this week or next week and I solved this by using a different function to refresh the page.
I hardcoded the backoffice URL and allowed that URL to be changed in a constants file. If you swap $scope.submit for this line it should work:
For this to work you will have to inject $window in your controller like you did with $scope and authResource. If you have a different backoffice URL you should ofcourse put that in the string instead of /umbraco
Hi Thomas,
Thanks for the reply, that's how i solved it as well, bad thing about this is if your automatically logged out from Umbraco all your changes will be gone because of the redirect.
// Herman
It's not my favorite solution either, but it's the only one I could get to work. Normally i use a different method in the angular controllers to refresh the page:
$route.reload()
. But when i use that method in the login controler it updates the URL but it doesn't refresh the view so for now this seems to be the only wayHi,
Someone found a way without reloading the page. For more info look at this issue: https://github.com/Dallas-msc/umbraco-2fa-with-google-authenticator/issues/1
-Joep
Works like a charm, thanks for sharing!
Hi,
I just did the same as Thomas and it worked a treat. Just just used regular JS. window.location.href = '/umbraco';
Remember to keep refreshing this page. I usually open the js file in the browser and force refresh. I then also force refresh the login screen.
This stuff is always cached and might not run your code changes.
Regards
David
I am getting ReferenceError: authResource is not defined. Is there any other way to submit dialogue editor content ?
Thanks.
is working on a reply...