Skip to content

Oauth - GitHub Login Screen Integration #3338

@coderabbitai

Description

@coderabbitai

Problem

The login screen does not initiate the GitHub flow or complete the exchange after deep-link callback.

Scope

  • Add GitHub button to initiate authorize().
  • On deep link, validate state and call OAuthService.signInWithOAuth with provider GITHUB.

Approach

Use DeepLinkHandler.listen to receive code/state and finalize the login.

Dependencies

  • Blocked By:
  • Blocks:

Files to Modify/Create

  • talawa/lib/views/auth/login_screen.dart
  • talawa/lib/services/oauth/deep_link_handler.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 for deep link completion)
_streamSub ??= deepLinkHandler.listen((code, state) async {
  // optional: verify state from SharedPreferences
  await oauthService.signInWithOAuth(
    provider: "GITHUB", 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