{"id":27047163,"url":"https://github.com/udaykiran75/userauthentication-js","last_synced_at":"2026-05-06T08:32:31.755Z","repository":{"id":222688944,"uuid":"750917515","full_name":"udaykiran75/UserAuthentication-js","owner":"udaykiran75","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-31T15:26:49.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T21:41:26.224Z","etag":null,"topics":["expressjs","javascript","nodejs","sql"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/udaykiran75.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-31T15:24:13.000Z","updated_at":"2025-06-05T14:57:18.000Z","dependencies_parsed_at":"2024-02-15T17:59:43.475Z","dependency_job_id":null,"html_url":"https://github.com/udaykiran75/UserAuthentication-js","commit_stats":null,"previous_names":["udaykiran75/userauthentication-js"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/udaykiran75/UserAuthentication-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaykiran75%2FUserAuthentication-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaykiran75%2FUserAuthentication-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaykiran75%2FUserAuthentication-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaykiran75%2FUserAuthentication-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/udaykiran75","download_url":"https://codeload.github.com/udaykiran75/UserAuthentication-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaykiran75%2FUserAuthentication-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32684643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expressjs","javascript","nodejs","sql"],"created_at":"2025-04-05T06:28:32.351Z","updated_at":"2026-05-06T08:32:31.740Z","avatar_url":"https://github.com/udaykiran75.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Authentication\n\nGiven an `app.js` file and a database file `userData.db` consisting of a  table `user`.\n\nWrite APIs to perform operations on the table `user` containing the following columns,\n\n**User Table**\n\n| Column   | Type    |\n| -------- | ------- |\n| username | TEXT |\n| name     | TEXT    |\n| password | TEXT    |\n| gender   | TEXT    |\n|location|TEXT|\n\n### API 1\n\n#### Path: `/register`\n\n#### Method: `POST`\n\n**Request**\n\n```\n{\n  \"username\": \"adam_richard\",\n  \"name\": \"Adam Richard\",\n  \"password\": \"richard_567\",\n  \"gender\": \"male\",\n  \"location\": \"Detroit\"\n}\n```\n\n- **Scenario 1**\n\n  - **Description**:\n\n    If the username already exists\n\n  - **Response**\n    - **Status code**\n      ```\n      400\n      ```\n    - **Status text**\n      ```\n      User already exists\n      ```\n\n- **Scenario 2**\n\n  - **Description**:\n\n    If the registrant provides a password with less than 5 characters\n\n  - **Response**\n    - **Status code**\n      ```\n      400\n      ```\n    - **Status text**\n      ```\n      Password is too short\n      ```\n\n- **Scenario 3**\n\n  - **Description**:\n\n    Successful registration of the registrant\n\n  - **Response**\n      - **Status code**\n        ```\n        200\n        ```\n      - **Status text**\n       ```\n       User created successfully\n       ```\n\n### API 2\n\n#### Path: `/login`\n\n#### Method: `POST`\n\n**Request**\n```\n{\n  \"username\": \"adam_richard\",\n  \"password\": \"richard_567\"\n}\n```\n\n- **Scenario 1**\n\n  - **Description**:\n\n    If an unregistered user tries to login\n\n  - **Response**\n    - **Status code**\n      ```\n      400\n      ```\n    - **Status text**\n      ```\n      Invalid user\n      ```\n\n- **Scenario 2**\n\n  - **Description**:\n\n    If the user provides incorrect password\n\n  - **Response**\n    - **Status code**\n      ```\n      400\n      ```\n    - **Status text**\n      ```\n      Invalid password\n      ```\n\n- **Scenario 3**\n\n  - **Description**:\n\n    Successful login of the user\n\n  - **Response**\n    - **Status code**\n      ```\n      200\n      ```\n    - **Status text**\n      ```\n      Login success!\n      ```\n\n### API 3\n\n#### Path: `/change-password`\n\n#### Method: `PUT`\n\n**Request**\n\n```\n{\n  \"username\": \"adam_richard\",\n  \"oldPassword\": \"richard_567\",\n  \"newPassword\": \"richard@123\"\n}\n```\n\n- **Scenario 1**\n\n  - **Description**:\n\n    If the user provides incorrect current password\n\n  - **Response**\n    - **Status code**\n      ```\n      400\n      ```\n    - **Status text**\n      ```\n      Invalid current password\n      ```\n\n- **Scenario 2**\n\n  - **Description**:\n\n    If the user provides new password with less than 5 characters\n\n  - **Response**\n    - **Status code**\n      ```\n      400\n      ```\n    - **Status text**\n      ```\n      Password is too short\n      ```\n\n- **Scenario 3**\n\n  - **Description**:\n\n    Successful password update\n\n  - **Response**\n    - **Status code**\n      ```\n      200\n      ```\n    - **Status text**\n      ```\n      Password updated\n      ```\n\n\n\u003cbr/\u003e\n\nUse `npm install` to install the packages.\n\n**Export the express instance using the default export syntax.**\n\n**Use Common JS module syntax.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudaykiran75%2Fuserauthentication-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fudaykiran75%2Fuserauthentication-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudaykiran75%2Fuserauthentication-js/lists"}