-
Notifications
You must be signed in to change notification settings - Fork 48
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
Completed The Tasks #4
base: main
Are you sure you want to change the base?
Conversation
middlewares/auth_required.js
Outdated
/*** | ||
* @todo Redirect the user to login page if token is not present. | ||
*/ | ||
const checkLogin = () => { | ||
// console.log(document.cookie); | ||
if(document.cookie=='')window.location.href = './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.
Make use of Framework specific methods rather than using Vanilla JS one
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.
So I have to use router instead of window.location.href and rather than checking document.cookie again and again I should use State ??
Is that all or I am still missing something?
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.
Yes
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.
I made a few changes to resolve those mistakes. Please review them.
} | ||
const API_BASE_URL = 'https://todo-app-csoc.herokuapp.com/' | ||
const dataForApiRequest = { | ||
username: document.getElementById('inputUsername').value, |
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.
You should have make use of React Hooks like useState to manage the states
CSOC Task 3 Submission
I have completed the following tasks
auth_required.js
andno_auth_required.js