-
-
Notifications
You must be signed in to change notification settings - Fork 412
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
feat: google authentication backend #819
Conversation
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.
Hello, @Santosh7017, thank you for opening a pull request.
Soon the maintainers/owner will review it and provide you with feedback/suggestions.
If you think it's something urgent, feel free to reach out to Tamal on Twitter.
Give us a β to show some support
Happy OpenSource π
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.
The changes look fine to me, can you perhaps record a short screencast (tools like Loom, OBS can be of help) and just show that the backend is working as intended ?
server/index.js
Outdated
app.get("/", (req, res) => { | ||
res.send("HELLO FROM HOME"); | ||
}); | ||
|
||
//* user routes | ||
app.use("/user", require("./routes/User")); | ||
app.use("/user", require("./routes/user")); |
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.
Please revert this back to ./routes/User
as we have the file name as User.js
having small letter can sometimes give rise to bugs.
This pull request has been deployed to Vercel.
|
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.
Amazing work,
This looks good to me, will be merged soon π.
It is pleasing to receive this information. what next to do, Should I proceed with closing the current issue and opening a new one for the frontend? |
Yaa sure go ahead ! |
Related Issue
ISSUE NUMBER #711
Changes made π·π»ββοΈ
This feature introduces the backend implementation of enhanced authentication functionality by integrating Google Account authentication. With this update, users will be able to securely authenticate and access the application using their Google Account credentials, providing an additional layer of authentication and simplifying the login process. This feature enhances the security and user experience of the application, ensuring reliable and convenient access for all users. The changes made in this pull request effectively enhance the overall authentication system, thereby strengthening the security and usability of the application.
Necessary steps to setup .env
these are the values of n .env file
CLIENT_ID = "" // OAuth client ID
CLIENT_SECRET = "" // OAuth client secret
CALLBACK_URL = "" // callback URL like (http://localhost:5000/auth/google/callback) in place of localhost put the live server's link where you will receive callback
successURL = "" // this URL will redirect user to the page where we want send him after succesfull authentication for example Home page URL(https://milaan.vercel.app/)
To create a Google OAuth client ID and client secret, you need to follow the steps below:
Go to the Google Cloud Console: Visit the Google Cloud Console at https://console.cloud.google.com/ and sign in with your Google account.
Create a new project: If you don't have a project yet, create a new project by clicking on the project drop-down menu at the top of the page and selecting "New Project". Give your project a name and click "Create".
Enable the necessary APIs: In the Cloud Console, go to the "APIs & Services" section. Click on "Library" in the left-hand menu. Search for and enable the following APIs:
Google OAuth 2.0 API
Set up OAuth consent screen: In the Cloud Console, navigate to the "APIs & Services" section and click on "OAuth consent screen" in the left-hand menu. Choose an appropriate user type and fill in the required information, such as the application name and authorized domains.
Create OAuth client ID: In the Cloud Console, go to the "APIs & Services" section and click on "Credentials" in the left-hand menu. Click on the "Create Credentials" button and select "OAuth client ID" from the drop-down menu.
Configure the OAuth client ID: Choose the application type, such as "Web application" or "Android/iOS app". Enter the necessary details, including authorized JavaScript origins or redirect URIs, depending on your application type. Save the configuration.
Obtain the client ID and client secret: Once you've created the OAuth client ID, the client ID and client secret will be displayed on the "Credentials" page. Make sure to copy and securely store these values as they are required for authenticating your application
to know more you can visit - https://support.google.com/cloud/answer/6158849?hl=en