Update documentations + Added Delete Account Feature tested manually#127
Update documentations + Added Delete Account Feature tested manually#127
Conversation
…ester is over into readme
Added information about providing own database and Firebase after grading is over into readme
Events include deadlines id
There was a problem hiding this comment.
This is just fixing typos
| How to set up the database will depend on whether the database services used for our development are still available: | ||
| - Before Spring 2025 grades are released, you may ask a team member for credentials. | ||
| - This way, graders may use the team's credentials for grading purposes. | ||
| - After grades are released, please provide your own PostgreSQL database and Firebase credentials. |
There was a problem hiding this comment.
Added descriptions on setting up database
| Ensure you are in the `backend` directory (which you should be if you completed the previous step). | ||
|
|
||
| **To add the schema to the development database:** | ||
| ```bash |
There was a problem hiding this comment.
Instructions on how to add scheme to database
| * @param res | ||
| * @constructor | ||
| */ | ||
| public static async deleteAccount(req: Request, res: Response): Promise<any> { |
There was a problem hiding this comment.
Deleting account by deleting all of the users preferences from the database
| @@ -0,0 +1,62 @@ | |||
| # Contributing | |||
|
|
|||
There was a problem hiding this comment.
Detailed instructions on how future users can contribute to our repository
| @@ -2,7 +2,7 @@ | |||
|
|
|||
| export default function ProfilePage() { | ||
| const { user, loading } = useAuth(); | ||
| const { user, deleteAccount, loading } = useAuth(); | ||
| // Using state to hold user preferences |
There was a problem hiding this comment.
Added delete account to the profile page
| if (!user?.uid) return; | ||
|
|
||
| // Delete user data from backend | ||
| const res = await axios.delete( |
There was a problem hiding this comment.
Deletes the user from both the database and firebase
|
|
||
| {/* Delete Account Button */} | ||
| <Dialog open={openDelete} onOpenChange={setOpenDelete}> | ||
| <DialogTrigger asChild> |
There was a problem hiding this comment.
Adds a delete account button and makes sure it's deleted
| } | ||
| console.log( | ||
| 'Deleting user: ' + user.displayName + ' with uid: ' + user.uid | ||
| ); |
There was a problem hiding this comment.
Deletes the user's account
|
|
||
| const deleteAccount = async () => { | ||
| if (!user) { | ||
| return () => { |
There was a problem hiding this comment.
Tells which user they're deleting
trappaly
left a comment
There was a problem hiding this comment.
Overall very throughout and detailed code. You also wrote very detailed descriptions and instructions in the README as well. You added a license, you added both the implementation and the frontend buttons for the user to delete an account, and updated the database schema.
As I said on discord, when I ran development it wouldn't delete my account. It would probably be a good idea for other teammates to check this though to see if it's a problem with my computer or with the code itself before I merge the pull request.
| @@ -0,0 +1,84 @@ | |||
| 'use client'; | |||
|
|
|||
| import { useState } from 'react'; | |||
There was a problem hiding this comment.
Updated reauthentication model so if you are signed in for a long time firebase will reauthenticate
| )} | ||
| {showReauthModal && ( | ||
| <div className="mt-4 border rounded p-4 bg-muted"> | ||
| <ReauthenticateModal |
There was a problem hiding this comment.
Added the reauthenticate model button if you're signed into your account for a long time to reauthenticate
trappaly
left a comment
There was a problem hiding this comment.
Looks good! I tested it and am able to delete my account now. I will merge the pull request.
Update docs
Delete Account Feature
How to test
/dashboard/profileand click Delete account -> Yes, delete.Expected behavior
/and not signed-in any more.