-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add authentication workflow #49
base: main
Are you sure you want to change the base?
[WIP] Add authentication workflow #49
Conversation
Am cheking on the checkmarks in description |
"Content-Type": "application/json", | ||
}, | ||
body: body, | ||
}); | ||
|
||
console.log("Registration Payload" + JSON.stringify(body)); | ||
|
||
if (res.status === 200) { | ||
if (res.status === 201) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this not supposed to be a 301
redirect code upon a successful registration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I could be wrong perhaps 301 would mean a redirect on failure, ill need to double-check this
.env
Outdated
@@ -1 +1,2 @@ | |||
NODE_ENV=development | |||
NEXT_PUBLIC_API_URL = 'https://localhost:8000' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are calling this ITEZ_API_URI
in current upstream
src/actions/authActions.ts
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ensure we use SWR
for all GET
requests at most
src/pages/api/account/register.ts
Outdated
}); | ||
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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