-
Notifications
You must be signed in to change notification settings - Fork 2k
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
s #33
Open
Venkatesh-4
wants to merge
57
commits into
safak:main
Choose a base branch
from
Venkatesh-4:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
s #33
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mainly the database part and added params to blog page and slug page
Done is such a way that if an existing connection exists then that will be used, otherwise a new connection is created.
Created userSchema and postSchema. Function to handle existing user and posts also written
functions to get all posts, single post, single user and all users
Dynamic image, title and description on single post page. Dynamic image and slug for the post card component postUser component username detail altered to reflect the DB schema. Changed the find fucntion to findOne to get single post as find was returning an array
Moved avatar handling from single post page to postUser component. Included dynamic date. Added necessary css for detail text and value. Added nessesary avatar css.
Managed to add a post to the data base through the use of a form
This reverts commit d760e70.
This reverts commit 98b31ff.
This reverts commit 8eff0e5.
Issue with the id of the freshly added post using the test page. the userId must apparently match the _id as part of mongoDB schema
Added get and post method to the API endpoint file. Wrote a function to handle logging into GitHub. Used a button to facilitate the login. Used a session variable to console log the session details. Added get and post handlers to the nest auth function
Moved the function that handle loggin in to GitHub into action.js. Also wrote a function to handle logging out. Initialized the session object within the NavBar component and passed it as a prop to the links component. Since links has the useState hook it can be an async function. Changed the isAdmin to make it dynamic, it checks the session object to identify the same.
callback function written check the data base if the user logged on through GitHub exists, if not add the user to the users table. altered the users table model to change the password field from being mandatory to facilitate the addition of user data when logged on through GitHub
Moved login page into (auth) folder to keep all the authentication related pages together. Created a register page and added some styling to it. Wrote a function for the registration form in action.js which saves the registered account in the database, it checks if the user already exists first.
Installed bcrypt. Used a bcrypt function to hash the password during registration. In the DB is hashed password is saved.
Uninstalled bcrypt and insalled bcryptjs. Added a form to login using credentials. Login function written in action.js. A credentials provider function that acts as a means to authorize the user was written in auth.js. loginpage -> action.js -> auth.js
Modified the register function to return the error object. Created a separate component for the registration form, since it is a client side component. Using the useFormState hook the error messages are dynamically displayed. Issue with the useEffect hook. after registration is a success the login page isn't automatically redirected into
Automatic redirection is fixed
Login form converted into a component. Styles added to login form and page
Nothing is being fetched in the login page, hence we can remove async. dynamic message returned for invalid username or password. next redirect automatically trows an error, to handle that we have written throw err
Using middleware to restrict the access to other pages from the login page. Right now other pages aren't accessible since the authorized function returns false
when logging in using credentials we the auth object now contails the id and isAdmin as well.
Wrote out authorization conditions for the admin panel, blog page, and the login page. Redirects based on the authorization function was also handled
Created function to add user and delete user
Admin page structure along with components created
Altered source in the case of missing images. coded up adminUsers component to fetch user data. Issue-changes not reflecting in the blog page
Since admin post from and admin user form require the userId, it is passed as an attribute to both these components. Admin post form component is complete, the userId is passed as a prop, through a hidden field in the form
Admin user form component created
Added style to the individual components and also to the admin dashboard as a whole.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.