# This initialiser is overwritten when deployed to preview, staging & production.

GDS::SSO.config do |config|
  config.user_model   = 'User'
  config.oauth_id     = ENV['OAUTH_ID']
  config.oauth_secret = ENV['OAUTH_SECRET']
  config.oauth_root_url = Plek.current.find('signon')
end

GDS::SSO.test_user = User.find_or_create_by(email: 'user@test.example.com').tap do |u|
  u.name = 'Test User'
  u.permissions = ['signin']
  u.save!
end

# This initialiser is overwritten when deployed to preview, staging & production.

GDS::SSO.config do |config|
  config.user_model   = 'User'
  config.oauth_id     = ENV['OAUTH_ID']
  config.oauth_secret = ENV['OAUTH_SECRET']
  config.oauth_root_url = Plek.current.find('signon')
end

Remove SSO test user autocreation.
Remove SSO test user autocreation.

This causes a catch 22 situation when trying to
run initial migrations or schema loads as rake
loads the rails environment and tries to access
the `users` table.  If the CreateUser migration
hasn't run yet, this causes an exception which
prevents the table being created.

We will revisit this in due course.