Skip to content

Apply standard registration flow to single-sign-on sign-ups

Hinam Mehra requested to merge 339256-fix-oauth-registration-flow into master

What does this MR do and why?

Resolves #339256

  • Changes the single-sign on registration flow to match the standard registration flow.
  • This change only affects the registration users/sign_up page. If a new user single-sign's on from the sign-in page users/sign-in then they get taken to the dashboard.

Screenshots or screen recordings

oauth-registration-flow

How to set up and validate locally

  1. Create an OAuth app in Github
  2. Add Github as an omniauth provider in config/gitlab.yml
development:
  <<: *base
  omniauth:
    allow_single_sign_on: ['github']
    block_auto_created_users: false
    providers:
      - { name: 'github',
          app_id: 'YOUR_APP_ID',
          app_secret: 'YOUR_APP_SECRET',
          url: "https://github.com/",
          verify_ssl: false,
          args: { scope: 'user:email' } }
  1. Enable the feature flag
$ bundle exec rails c
Feature.enable(:update_oauth_registration_flow)
  1. If you want to retest the flow multiple times, you can delete the records from the following tables:
$ user_id = User.find_by(email: 'YOUR_OAUTH_EMAIL').id
$ Identity.find_by(user_id: user_id).delete
$ User.find(user_id).delete

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hinam Mehra

Merge request reports