Login from custom code/app?


#1

Hello,

As we are building the dashboard for our needs, with completely custom code, in React… our app still lives inside the Userfrosting dashboard skeleton.

We are hoping to be able to provide 100% our own dashboard from within the app, and not load any of the UF template/css/js code.

One of the puzzles is how to handle user log-in, and authentication.

Do you have any pointers on how to get started?

Is this expected to be a troublesome procedure, in the way UF is designed?

Thank you


#2

If I understand correctly, you’re just wanting to ‘re-theme’ UF with a react front end and still using all the routes and logic that UF has in place. If so it shouldn’t be too hard. You just need to make sure you align the right api endpoints for the login and registration and ensure you are sending through the correct data for the endpoint to function.

Eg. Build out your login form in React, ensure you match the name and id values to the same ones as for the UF login page, and then make sure you pass all the required information from the react form to the right url as part of a POST request and everything should theoretically work (might need some tweaking).


#3

Precisely.

Not sure how I would handle the authentication/session/token stuff from Javascript though. If I go this route, I won’t be using jQuery. It will be strictly React/ES6+.

Thanks