Melsaeed276 / Melsaeed276/Hatim_Program

auth: login with phone (+password if set) or Google

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Goal

Implement login flow using phone number + optional password logic, and Google sign-in.

Requirements

  • Support login by phone number.
  • If user has password (passwordEnabled = true): require password validation.
  • If user has no password (passwordEnabled = false): login allowed when phone exists in DB.
  • Support Google sign-in login.

Firebase Scope

  • Authenticate via Firebase Auth.
  • Read user profile from Firestore (users collection).
  • Keep login behavior consistent with sign-up data model.

Functional Behavior

  • Phone login flow:
    • Lookup user by phone number.
    • Branch on passwordEnabled:
      • true -> verify provided password against hash.
      • false -> no password prompt; allow login if user exists.
  • Google login flow:
    • Sign in with Google provider.
    • Link/fetch corresponding user profile.
  • Return clear errors for:
    • user not found
    • wrong password
    • provider mismatch or missing profile record

Acceptance Criteria

  • Phone users with password cannot login without password.
  • Phone users without password can login using phone existence check.
  • Google users can login via Google successfully.
  • Session state and user profile are loaded after successful login.
  • Error handling is clear and testable.

Notes

  • Password storage/verification must remain hashed only.
  • Add tests for both password-enabled and password-disabled login paths.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Firebase Auth login entry point and inspect how profiles are read from the Firestore users collection and how sign-up stores passwordEnabled data. Trace the phone and Google flows, including session and profile loading, then add tests for password-enabled and password-disabled phone users plus Google login and the specified errors. Done means all acceptance criteria pass without exposing unhashed passwords.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, firebase, flutter
Domain
authentication, database, mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.