Skip to content

Login with Gitea OAuth problems: external user ID not properly recorded #514

@gytisrepecka

Description

@gytisrepecka

Describe the bug

When Gitea OAuth is used for logging in, external user ID is not properly recorded in oauth_users.remote_user_id which causes misbehavior when logging in with different external users from Gitea server.

Steps to reproduce

Steps to reproduce the behavior:

  1. Login to WriteFreely with user_a;
  2. Associate user_a with Gitea user gitea_user_a;
  3. Login to WriteFreely with user_b;
  4. Associate user_b with Gitea user gitea_user_b;
  5. Attempt to login with Gitea user gitea_user_b - you will be logged in as user_a while it is expected to be user_b.

Expected behavior

Expected behavior is logging in with gitea_user_a logs into user_a while gitea_user_b logs into user_b.

Application configuration

  • Single mode or Multi-user mode? Multi-user
  • Database? [mysql/sqlite] MySQL
  • Open registration? [yes/no] Yes and No
  • Federation enabled? [yes/no] Yes

Version or last commit: v0.13.1

To solve this issue it is required to add extra auth fields into Gitea implementation code in the same way as they are available in oauth_generic.go. Pull request will be submitted in a moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions