Skip to content

Oauth - Google Login Screen Integration #3336

@coderabbitai

Description

@coderabbitai

Problem

The login screen does not expose a Google login button or complete the token exchange with the backend.

Scope

  • Add Google button to login screen.
  • On authorize(), call OAuthService.signInWithOAuth with provider GOOGLE.

Approach

  • Inject OAuthService in the screen; on success, navigate to the app home.

Dependencies

  • Blocked By:
  • Blocks:

Files to Modify/Create

  • talawa/lib/views/auth/login_screen.dart
  • talawa/lib/widgets/oauth/oauth_login_section.dart

Acceptance Criteria

  • All existing functionality must be maintained
  • Implementation must ensure no breaking changes when PR is merged

Testing Requirements

  • All tests must pass successfully
  • Code coverage must be >= 96%

Sample Code

This sample code is only representative of what could be done. It is provided only to give a general outline. You will need to use your initiative and industry best practices to find a solution that is suitable for the application.

// talawa/lib/views/auth/login_screen.dart (snippet)
onGooglePressed: () async {
  final code = await googleProvider.authorize();
  if (code == null) return;
  await oauthService.signInWithOAuth(
    provider: "GOOGLE", authorizationCode: code, redirectUri: "talawa://oauth/callback");
},

Metadata

Metadata

Labels

dartPull requests that update Dart codesecuritySecurity fixui/uxissue related and being worked with the figma file of the Admin UI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions