[WIP] Add authentication workflow#49
[WIP] Add authentication workflow#49bupemulenga13 wants to merge 6 commits intoDigital-Prophets:mainfrom
Conversation
|
Am cheking on the checkmarks in description |
| console.log("Registration Payload" + JSON.stringify(body)); | ||
|
|
||
| if (res.status === 200) { | ||
| if (res.status === 201) { |
There was a problem hiding this comment.
is this not supposed to be a 301 redirect code upon a successful registration?
There was a problem hiding this comment.
Ah I could be wrong perhaps 301 would mean a redirect on failure, ill need to double-check this
| @@ -1 +1,2 @@ | |||
| NODE_ENV=development | |||
| NEXT_PUBLIC_API_URL = 'https://localhost:8000' No newline at end of file | |||
There was a problem hiding this comment.
we are calling this ITEZ_API_URI in current upstream
| try { | ||
| console.log("Try catch hit"); | ||
| let body = JSON.stringify(user); | ||
| let res = await fetch(`/api/account/login`, { |
There was a problem hiding this comment.
ensure we use SWR for all GET requests at most
|
|
||
| try { | ||
| const apiRes = await fetch(`${API_URL}/api/user/`, { | ||
| const apiRes = await axios.post(`${config.ITEZ_API_URI}/api/users/`, { |
There was a problem hiding this comment.
potential blocker here
This picks up ITEZ_APPI_URI from env vars meanwhile in there we have what is called NEXT_API_URL
so lets unify everything to ITEZ_API_URI and all should be streamlined properly
#33
NOTE:
With current PR just pushed the following has been modified