Require authentication for most endpoints #29

Merged
atomaka merged 4 commits from authorization into main 2024-09-08 21:07:51 -04:00
Showing only changes of commit d0b4d000eb - Show all commits

View file

@ -14,14 +14,15 @@
<body> <body>
<nav class="w-100 p-6 bg-gray-900 flex items-center justify-between flex-wrap"> <nav class="w-100 p-6 bg-gray-900 flex items-center justify-between flex-wrap">
<ul class="flex"> <ul class="flex">
<% if Current.user.registered? %>
<li class="mr-6"><%= link_to "Dashboard", root_path, class: "text-white" %></li> <li class="mr-6"><%= link_to "Dashboard", root_path, class: "text-white" %></li>
<li class="mr-6"><%= link_to "Expenses", expenses_path, class: "text-white" %></li> <li class="mr-6"><%= link_to "Expenses", expenses_path, class: "text-white" %></li>
<li class="mr-6"><%= link_to "Credit Card Bills", credit_card_bills_path, class: "text-white" %></li> <li class="mr-6"><%= link_to "Credit Card Bills", credit_card_bills_path, class: "text-white" %></li>
<li class="mr-6"><%= link_to "Incomes", incomes_path, class: "text-white" %></li> <li class="mr-6"><%= link_to "Incomes", incomes_path, class: "text-white" %></li>
<li class="mr-6"><%= link_to "Members", members_path, class: "text-white" %></li> <li class="mr-6"><%= link_to "Members", members_path, class: "text-white" %></li>
<% if Current.user.registered? %>
<li class="mr-6"><%= link_to "Log out", session_path, data: {turbo_method: :delete}, class: "text-white" %></li> <li class="mr-6"><%= link_to "Log out", session_path, data: {turbo_method: :delete}, class: "text-white" %></li>
<% else %> <% else %>
<li class="mr-6"><%= link_to "Sign up", new_user_path, class: "text-white" %></li>
<li class="mr-6"><%= link_to "Log in", new_session_path, class: "text-white" %></li> <li class="mr-6"><%= link_to "Log in", new_session_path, class: "text-white" %></li>
<% end %> <% end %>
</ul> </ul>