Im im using craft as a headless CMS to power a Nuxt frontend.
I have a situation where i need the user to login on the frontend and then be redirected to a url within the craft CMS admin.
My question is; how do i persist login from a subdomain (my Nuxt front-end login form) to to the root domain where my CMS admin is located? Or how can i log the user in to the CMS dashboard using the response from an axios login?
More info:
Frontend: mydomain.com
CMS install: my-craft-install.mydomain.com
Frontend:
My frontend login form is using axios e.g:
const data = {
email,
password
};
const response = await axios.post("myfrontend.mydomain.com/api/user/login", qs.stringify(data))
SAML Redirect:
After successful login the user will be redirected to a url required by the plugin "SAML Identity Provider" which is under the url
https://my-craft-install.mydomain.com/sso/login/request/[key]
From here the user will be authenticated by the plugin and redirected again to our 'Brilliant Assessment' sub domain.
Any help would be greatly appreciated. Cheers, Jamie