Skip email verification on sign in for QA users
What does this MR do and why?
Skip email verification on Sign In for QA users on staging environment.
When the feature flag is turned on on staging, tests will fail, see slack discussion.
This allows skipping email verification when ENV['GITLAB_QA_USER_AGENT']
is present and the current request's user agent matches it's value.
How to set up and validate locally
Verify required email verification is working:
- In Rails console, run:
Feature.enable(:require_email_verification)
- Visit
http://localhost:3000/users/sign_in
and try to sign in 3 times with a wrong password - Sign in with your correct password and verify you need to verify your identity by email
Verify required email verification is skipped when acting as a QA user:
- Note your browser user agent by typing
navigator.userAgent
in the inspector - Simulate GL.com and set the QA header to the browser user agent by running these commands in the console from the gdk root:
gdk stop echo export GITLAB_SIMULATE_SAAS=1 >> env.runit echo export GITLAB_QA_USER_AGENT="<your browser's user agent>" >> env.runit gdk restart
- Visit
http://localhost:3000/users/sign_in
and try to sign in 3 times with a wrong password - Sign in with your correct password and verify you don't need to verify your identity by email
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Alex Buijs