Skip to content

OAuth integration UserRepository::findByOAuthID() function is empty #2388

@ctwidodo

Description

@ctwidodo

Bug Description

Issue when integrating OAuth with different services such as Github. Note that I'm using database for the User instead of Stache. Looking at the Stache\UserRepository, it seems the findByOAuthId() is implemented correctly.
The error message is
TypeError Return value of Statamic\Auth\Eloquent\UserRepository::findByOAuthId() must be an instance of Statamic\Contracts\Auth\User or null, none returned

How to Reproduce

I followed the steps on the Statamic OAuth page

  1. Added oauth provider to statmic/oauth.php
  2. Add provider credential to config/services.php
  3. Update config/statamic/oauth.php with the service
  4. Add login redirect route and callback route in config/statamic/oauth.php.
  5. Try to login using Github from CP or try logging in with {{ oauth:github }} from frontend.

Extra Detail

Screen Shot 2020-09-08 at 20 46 32

Screen Shot 2020-09-08 at 20 46 42

Environment

Statamic version: 3.0.0 Pro

PHP version: 7.3.21

Install method (choose one):

  • Fresh install from statamic/statamic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions