Skip to content
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

Ft google auth #187419170 #27

Closed
wants to merge 6 commits into from
Closed

Conversation

MugemaneBertin2001
Copy link
Collaborator

@MugemaneBertin2001 MugemaneBertin2001 commented Apr 23, 2024

what does this PR do?

  • Help user to sign up and login with existing google account

Description of Task to be completed:

  • As a user I should be able to athenticate (register/login) via Google

how to test it

  • go to ft-google-auth-#187419170 branch
  • clone this repo
  • create and fill .env with local configuration
  • run the app
  • go to browser : localhost:3000/login
  • click on URL for login with google
  • follow on screen instruction

.env.example Outdated
Comment on lines 9 to 12
CLOUDINARY_CLOUD_NAME= "" use yours
CLOUDINARY_API_KEY= "" use yours
CLOUDINARY_API_SECRET= "" use yours
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed it

Comment on lines 1 to 14
{
"sqltools.connections": [
{
"previewLimit": 50,
"server": "localhost",
"port": 5432,
"driver": "PostgreSQL",
"name": "new",
"group": "new",
"database": "ecommerce_db",
"username": "postgres"
}
]
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please pay attention

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added .vscode in .gitignore and removed it

Comment on lines 18 to 29
expect(response.status).toBe(200);
}, 20000);
test("server should return status code of 200 and link to log in with google --> given'/login'", async () => {
const response = await request(app).get("/login");
expect(response.text).toBe("<a href='/auth/google'>click to here to Login</a>")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should test what you have done not what you use to test it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added tests for my endpoints

app.use(cors());

app.use("/", homeRoute);
app.use("/api/v1", appROutes);
app.use("/docs", docRouter);
app.use('/', googleRoutes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this here,

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refined as requested

@teerenzo
Copy link
Member

PR name and description is wrong please check on naming convertion again

{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected '}'.

},
{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected ')' and instead saw 'tseslint'.
Expected '}' to match '{' from line 18 and instead saw '...'.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
Unrecoverable syntax error. (39% scanned).

ignores: ["**/__test__", "**/*.json"],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'spread/rest operator' is only available in ES6 (use 'esversion: 6').

@@ -0,0 +1,51 @@
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -0,0 +1,51 @@
const eslint = require("@eslint/js");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected '}'.

},
{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected ')' and instead saw 'tseslint'.
Expected '}' to match '{' from line 18 and instead saw '...'.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
Unrecoverable syntax error. (39% scanned).

ignores: ["**/__test__", "**/*.json"],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'spread/rest operator' is only available in ES6 (use 'esversion: 6').

@@ -0,0 +1,51 @@
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -0,0 +1,51 @@
const eslint = require("@eslint/js");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected '}'.

},
{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected ')' and instead saw 'tseslint'.
Expected '}' to match '{' from line 18 and instead saw '...'.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
Unrecoverable syntax error. (39% scanned).

ignores: ["**/__test__", "**/*.json"],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'spread/rest operator' is only available in ES6 (use 'esversion: 6').

@@ -0,0 +1,51 @@
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -0,0 +1,51 @@
const eslint = require("@eslint/js");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected '}'.

},
{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected ')' and instead saw 'tseslint'.
Expected '}' to match '{' from line 18 and instead saw '...'.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
Unrecoverable syntax error. (39% scanned).

ignores: ["**/__test__", "**/*.json"],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'spread/rest operator' is only available in ES6 (use 'esversion: 6').

@@ -0,0 +1,51 @@
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -0,0 +1,51 @@
const eslint = require("@eslint/js");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected '}'.

},
{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected ')' and instead saw 'tseslint'.
Expected '}' to match '{' from line 18 and instead saw '...'.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
Unrecoverable syntax error. (39% scanned).

ignores: ["**/__test__", "**/*.json"],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'spread/rest operator' is only available in ES6 (use 'esversion: 6').

@@ -0,0 +1,51 @@
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -0,0 +1,51 @@
const eslint = require("@eslint/js");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Copy link

gitguardian bot commented Apr 26, 2024

⚠️ GitGuardian has uncovered 7 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
10286351 Triggered Company Email Password 68e9929 src/sequelize/seeders/20240412144111-demo-user.js View secret
10286351 Triggered Company Email Password bd9384b src/sequelize/seeders/20240412144111-demo-user.js View secret
10286352 Triggered Generic Password 68e9929 src/sequelize/seeders/20240412144111-demo-user.js View secret
10286352 Triggered Generic Password bd9384b src/sequelize/seeders/20240412144111-demo-user.js View secret
10286352 Triggered Generic Password bd9384b src/sequelize/seeders/20240412144111-demo-user.js View secret
10286352 Triggered Generic Password 68e9929 src/sequelize/seeders/20240412144111-demo-user.js View secret
10538571 Triggered Generic Password 12b02a5 test/user.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@teerenzo
Copy link
Member

teerenzo commented Apr 26, 2024

you have many commits bertin squash them and are you sure you have changed 40 files

IRUMVAEmmanuel1 and others added 6 commits April 26, 2024 15:57
   - Implement the feature to allow users update their password
   - Added validation check for old password, new password and confirm
     password
   - hash the new password before updating
   - documented the feature using swagger

[Delivers #187419174]
- Add signin and sign up with google account
- return access token
- added test

delivers #187419170
@MugemaneBertin2001 MugemaneBertin2001 force-pushed the ft-google-auth-#187419170 branch from 4566a10 to b0fc4f4 Compare April 26, 2024 14:25
@MugemaneBertin2001 MugemaneBertin2001 deleted the ft-google-auth-#187419170 branch April 29, 2024 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants