nfoert / cardie

An open source business card designer and sharing platform
https://cardie-uwtwy.ondigitalocean.app/
GNU General Public License v3.0
388 stars 24 forks source link

Implement Google Sign-In for User Authentication #57

Closed VanshChitransh closed 1 month ago

VanshChitransh commented 1 month ago

Feature Request: Add "Sign in with Google" Functionality

Description:

Implement the "Sign in with Google" functionality to allow users to sign in to the application using their Google accounts. This feature will simplify the authentication process, improve user convenience, and potentially increase user engagement by offering a widely used and trusted login option.

Benefits:

Proposed Solution:

  1. Integrate Google OAuth 2.0:

    • Use Google’s OAuth 2.0 API to enable secure and seamless login functionality.
    • Allow users to authenticate with their Google accounts and access the app.
  2. Update User Interface:

    • Add a "Sign in with Google" button to the login/signup page.
    • Ensure the button adheres to Google's branding and design guidelines for third-party sign-ins.
  3. Backend Changes:

    • Implement necessary changes to handle Google tokens and link them with user accounts in the app’s database.
    • Ensure token validation and secure user session management.
  4. Testing:

    • Perform thorough testing to ensure that the "Sign in with Google" functionality works across various devices and browsers.
    • Check for possible edge cases (e.g., if a user already has an account with the same email).

User Flow:

  1. User clicks the "Sign in with Google" button.
  2. User is redirected to Google’s authentication page.
  3. Upon successful authentication, the user is redirected back to the application.
  4. The app creates/updates the user’s account and logs them in.

ScreenShot:

Screenshot from 2024-10-02 01-27-24

Priority:

Medium

Dependencies:

Additional Information:

VanshChitransh commented 1 month ago

@nfoert i would like to take this issue.

ar4s commented 1 month ago

@VanshChitransh What plan do you have for this? As far as I know there is no proper auth system in this code and I am curious how you want to solve this problem.

VanshChitransh commented 1 month ago

@ar4s I think OAuth will be best for it. What's your opinion?

ar4s commented 1 month ago

Of course OAuth - it is an industry standard but how you want to add that to the project? Do you want implement handling OAuth from scratch? I'm asking because I want to know more implementation details, because it's not a trivial task and more likely you don't want to waste your time reinventing the wheel.

spline2hg commented 1 month ago

hey @ar4s we can use django allauth right

ar4s commented 1 month ago

@VanshChitransh and the most important question: it is your idea or generated by AI? To be clear I am not against (I use copilot and chat gpt a lot) and feature is must have but I don't think it's fair that you create a ticket and then beg to be personally done with it.

EDIT: Project has been written in Python/Django - do you know that stack?

ar4s commented 1 month ago

@spline2hg :+1: exactly! Then issues #32 and #42 will be resolved.

nfoert commented 1 month ago

@VanshChitransh this is a duplicate of #51, that issue has already been assigned to the user that suggested it first. There has been some good discussion here on how it could be implemented however, so this has been linked in the first issue. Thank you everyone!