Closed coolemur closed 6 years ago
Never tried that, i'm not sure if the session cookies would be available until you refresh the page.
@rhukster cookies are not the issue for us (also after ajax call we can save cookies).
Checking if user has permissions to make some actions would be nice tho.
There is no logic built in for that. You’ll have to create your own endpoint to be reached via Ajax and with all the logic to do the checks you need to do.
The only way to use Ajax for logging in is by simply submitting the form via Ajax but there is no api so what it will do is just hide the submit behind an Ajax call rather than page reload.
Looking for a way to check if GRAV registered user has permissions to do specific actions on the website.
Something like:
function isAuthenticated() { $.ajax({ url: "myWebsite/auth", ... }).done(function() { ... if (authenticated) { return true; } else { return false; } }); }
Is this even possible ?