E
E
Eugene2018-04-20 15:48:12
JavaScript
Eugene, 2018-04-20 15:48:12

How to do registration/authorization in React?

Hello!
Can you suggest which way to dig? You need to implement registration / authorization in React. Laravel is used on the backend. In general, how is it done?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Biocoder, 2018-04-21
@nimfai

Start with the API, I advise you to use JWT (for Laravel there is https://github.com/tymondesigns/jwt-auth )
Then you make forms and send requests via fetch / axios
The session can be stored in Redux / MobX
If you want, I can pull the implementation from the current project and put it on github as an example

R
Roman Aleksandrovich, 2018-04-20
@RomReed

There are 2 solutions. The first is to use ssr (side rendering server). The second way is much faster to write an api to which you knock on the api from react using fetch or axios (better than it) and take the necessary data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question