HCA goes live (#687)

This commit is contained in:
Max Wofford
2025-12-05 11:53:35 -05:00
committed by GitHub
parent 5f4cc09758
commit e27a135036
2 changed files with 8 additions and 11 deletions

View File

@@ -19,7 +19,6 @@ class SessionsController < ApplicationController
@user = User.from_hca_token(params[:code], redirect_uri)
# if @user&.persisted?
if @user&.persisted?
session[:user_id] = @user.id
@@ -27,7 +26,7 @@ class SessionsController < ApplicationController
MigrateUserFromHackatimeJob.perform_later(@user.id)
end
redirect_to root_path, notice: "Successfully signed in with Slack! Welcome!"
redirect_to root_path, notice: "Successfully signed in with Hack Club Auth! Welcome!"
else
redirect_to root_path, alert: "Failed to authenticate with Hack Club Auth!"
end

View File

@@ -24,17 +24,15 @@
<% else %>
<h1 class="font-bold mt-1 mb-1 text-5xl text-center">Track How Much You <span class="text-primary">Code</span></h1>
<div class="flex flex-col w-full max-w-[50vw] mx-auto mb-22">
<% if params[:hca_auth].present? %>
<%= link_to hca_auth_path, class: "inline-flex items-center justify-center px-6 py-3 rounded text-white font-bold cursor-pointer border-none w-full my-2 bg-primary" do %>
<img src="/images/slack.png" class="h-8 w-8 mr-2 bg-white rounded-full p-1">
<span class="hidden md:flex">Sign in with Hack Club</span>
<% end %>
<%= link_to hca_auth_path, class: "inline-flex items-center justify-center px-6 py-3 rounded text-white font-bold cursor-pointer border-none w-full my-2 bg-primary" do %>
<span class="hidden md:flex">Sign in with Hack Club</span>
<% end %>
<%= link_to slack_auth_path, class: "inline-flex items-center justify-center px-6 py-3 rounded text-white font-bold cursor-pointer border-none w-full my-2 bg-primary" do %>
<img src="/images/slack.png" class="h-8 w-8 mr-2 bg-white rounded-full p-1">
<span class="hidden md:flex">Sign in with Slack</span>
<% end %>
<p class="text-center text-gray-400 text-sm">
<%= link_to slack_auth_path, class: "text-gray-400 hover:text-primary underline" do %>
Sign in with Slack instead
<% end %>
</p>
<div class="flex items-center my-4">
<div class="flex-1 border-t border-gray-600"></div>