Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def logout!

helper_method :redirect_path
def redirect_path
'/auth/github'
'/auth/codebar'
end

def authenticate_admin!
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/auth_services_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def new
if Rails.application.routes.recognize_path(referer_path)[:controller].in?(%w[workshops events meetings])
session[:referer_path] = referer_path
end
redirect_to '/auth/github'
redirect_to '/auth/codebar'
end

def create
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/terms_and_conditions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def update
# The show action skips accept_terms, but unauthenticated users can still
# POST directly to update. Redirect to login to avoid NoMethodError on nil.
unless logged_in?
redirect_to '/auth/github'
redirect_to '/auth/codebar'
return
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_navigation.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
Job Board
- if !logged_in?
%li.nav-item
= link_to '/auth/github', class: 'nav-link border-0' do
= link_to redirect_path, class: 'nav-link border-0' do
Sign in
- else
- if current_user.is_admin? || current_user.organiser? || current_user.monthlies_organiser?
Expand Down
2 changes: 1 addition & 1 deletion app/views/terms_and_conditions/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
%p
= t('terms_and_conditions.login_required_html')
%br
= link_to t('terms_and_conditions.login_link_text'), '/auth/github'
= link_to t('terms_and_conditions.login_link_text'), redirect_path

- if logged_in? && !current_user.accepted_toc_at?
= simple_form_for @terms_and_conditions_form, url: terms_and_conditions_path, method: :patch do |f|
Expand Down
4 changes: 2 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ en:
not_logged_in: "You must be logged in to access this page."
signing_up: "Thanks for signing up. Please fill in your details to complete the registration process."
authentication_error: "Authentication failed. Please try again."
email_missing_from_provider: "We could not retrieve your email address from GitHub. Please make sure your GitHub account has a public email address and try again."
email_missing_from_provider: "We could not retrieve your email address. Please make sure your account has a public email address and try again."
navigation:
dashboard: "Dashboard"
code_of_conduct: "Code of Conduct"
Expand Down Expand Up @@ -361,7 +361,7 @@ en:
accept: "Accept"
already_accepted_html: "You have already accepted our Code of Conduct on %{date}."
login_required_html: "Please log in to accept our Code of Conduct."
login_link_text: "Log in with GitHub"
login_link_text: "Log in with codebar"
messages:
notice: "You have to accept the Terms and Conditions before you are able to proceed."
footer:
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/auth_services_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
request.env["HTTP_REFERER"] = expected_referer_path

get :new
expect(response).to redirect_to("/auth/github")
expect(response).to redirect_to("/auth/codebar")
expect(session[:referer_path]).to eq(expected_referer_path)
end

Expand All @@ -14,7 +14,7 @@
request.env["HTTP_REFERER"] = expected_referer_path

get :new
expect(response).to redirect_to("/auth/github")
expect(response).to redirect_to("/auth/codebar")
expect(session[:referer_path]).to eq(expected_referer_path)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/fabricators/auth_service_fabricator.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Fabricator(:auth_service) do
provider { Faker::Company.name }
provider 'codebar'
uid { Fabricate.sequence(:uid) { |n| "sq#{n}" } }
end
4 changes: 2 additions & 2 deletions spec/features/accepting_terms_and_conditions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RSpec.feature 'Accepting Terms and Conditions', type: :feature do
context 'When a user signs up to codebar' do
before do
mock_github_auth
mock_codebar_auth
end

scenario "they can't proceed unless they accept the ToCs" do
Expand Down Expand Up @@ -85,7 +85,7 @@
visit terms_and_conditions_path

expect(page).to have_content('Please log in to accept our Code of Conduct.')
expect(page).to have_link('Log in with GitHub')
expect(page).to have_link('Log in with codebar')
end

scenario 'they see a disabled form' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/member/login_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

describe 'Sign up' do
describe 'when not all required details are set' do
it 'handles the registration when a user does not have a name set on github' do
it 'handles the registration when a user does not have a name set' do
mock_auth_hash(name: nil)

visit root_path
Expand Down
2 changes: 1 addition & 1 deletion spec/features/member_joining_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RSpec.feature 'A new student signs up', type: :feature do
before do
mock_github_auth
mock_codebar_auth
end

scenario 'A visitor can access signups through the landing page' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/member_portal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
end

it 'is redirected to sign_in page when they attempt not access the profile page' do
mock_github_auth
mock_codebar_auth
visit profile_path

expect(page).to_not have_selector('#member_profile')
Expand Down
2 changes: 1 addition & 1 deletion spec/features/member_updating_details_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RSpec.feature 'Update your details', type: :feature do
before do
mock_github_auth
mock_codebar_auth
end

scenario 'A member adds a dietary restriction' do
Expand Down
4 changes: 2 additions & 2 deletions spec/features/subscribing_to_newsletter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RSpec.feature 'Subscribing to the newsletter', type: :feature do
before do
OmniAuth.config.mock_auth[:github] = OmniAuth::AuthHash.new(
provider: 'github',
OmniAuth.config.mock_auth[:codebar] = OmniAuth::AuthHash.new(
provider: 'codebar',
uid: '42',
credentials: { token: 'Fake token' },
info: {
Expand Down
4 changes: 2 additions & 2 deletions spec/support/helpers/login_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def login_as_organiser(member, chapter)
login(member)
end

def mock_github_auth
mock_auth_hash
def mock_codebar_auth
mock_auth_hash(provider: 'codebar')
end

def accept_toc
Expand Down
4 changes: 2 additions & 2 deletions spec/support/omniauth.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'omniauth'

module OmniauthMacros
def mock_auth_hash(name: Faker::Name.name, email: Faker::Internet.email, provider: 'github', uid: 'uid')
OmniAuth.config.mock_auth[:github] = {
def mock_auth_hash(name: Faker::Name.name, email: Faker::Internet.email, provider: 'codebar', uid: 'uid')
OmniAuth.config.mock_auth[provider.to_sym] = {
provider: provider,
uid: uid,
info: {
Expand Down