Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
davilajose23 committed Aug 29, 2024
1 parent 2765e1e commit 8d3d78e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/constraints/authenticated_constraint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ class AuthenticatedConstraint
def matches?(request)
request.session[:user_id].present?
end
end
end
2 changes: 1 addition & 1 deletion app/constraints/unauthenticated_constraint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ class UnauthenticatedConstraint
def matches?(request)
request.session[:user_id].nil?
end
end
end
2 changes: 1 addition & 1 deletion app/controllers/concerns/authentication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def authenticate_user!
authenticate_user

if !user_signed_in?
flash[:notice] = "You need to sign in or sign up before continuing."
flash[:notice] = I18n.t("authentication.unauthenticated")
redirect_to new_user_session_path
end
end
Expand Down
12 changes: 6 additions & 6 deletions app/helpers/navigation_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ def show_header?
def show_bottom_navbar?
current_page?(sessions_path) ||
(user_signed_in? || !current_page?(unauthenticated_root_path)) &&
!current_page?(new_registration_path) &&
!current_page?(new_user_session_path) &&
!current_page?(new_password_reset_path) &&
!current_page?(edit_password_reset_path) &&
!current_page?(post_submit_password_reset_path) &&
!current_page?(coming_soon_path)
!current_page?(new_registration_path) &&
!current_page?(new_user_session_path) &&
!current_page?(new_password_reset_path) &&
!current_page?(edit_password_reset_path) &&
!current_page?(post_submit_password_reset_path) &&
!current_page?(coming_soon_path)
end

def title(title)
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/_bottom_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
<% end %>
<% end %>
<%= link_to(
notifications_path,
class: [
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ en:
live: "Live"
starting_soon: "Starting soon"
submit: "Apply"
authentication:
unauthenticated: "You need to sign in or sign up before continuing."
authorization:
unauthorized: "You are not authorized to access this page."
session_mailer:
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Rails.application.routes.draw do

constraints AuthenticatedConstraint.new do
root "sessions#index"
end
Expand Down

0 comments on commit 8d3d78e

Please sign in to comment.