Skip to content

Commit

Permalink
Fix console errors and oidc login
Browse files Browse the repository at this point in the history
  • Loading branch information
alxlion committed Aug 11, 2024
1 parent cdc4fce commit 1d75124
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
11 changes: 10 additions & 1 deletion lib/claper_web/controllers/user_session_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,19 @@ defmodule ClaperWeb.UserSessionController do
def create(conn, %{"user" => user_params}) do
%{"email" => email, "password" => password} = user_params

oidc_provider_name = Application.get_env(:claper, :oidc)[:provider_name]
oidc_logo_url = Application.get_env(:claper, :oidc)[:logo_url]
oidc_enabled = Application.get_env(:claper, :oidc)[:enabled]

if user = Accounts.get_user_by_email_and_password(email, password) do
UserAuth.log_in_user(conn, user, user_params)
else
render(conn, "new.html", error_message: "Invalid email or password")
render(conn, "new.html",
error_message: "Invalid email or password",
oidc_provider_name: oidc_provider_name,
oidc_logo_url: oidc_logo_url,
oidc_enabled: oidc_enabled
)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/claper_web/live/event_live/event_card_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ defmodule ClaperWeb.EventLive.EventCardComponent do
class="mt-2 flex flex-col space-y-2 sm:space-y-0 justify-between sm:flex-row items-center"
>
<div
id={"event-infos-#{@event.uuid}"}
id={"event-infos-2-#{@event.uuid}"}
class="text-sm w-full sm:w-auto font-medium text-gray-700 flex justify-center space-x-1 sm:space-y-0 items-center relative"
>
<button
Expand Down
14 changes: 0 additions & 14 deletions lib/claper_web/live/event_live/event_form_component.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -277,20 +277,6 @@
to={Date.add(Date.utc_today(), 365)}
/>
</div>

<%= if @action == :edit do %>
<div
phx-hook="QRCode"
id="qr"
data-code={@event.code}
data-get-url="true"
data-height="340"
data-width="340"
phx-update="ignore"
class="rounded-lg mx-auto bg-white w-64 h-64 p-12 items-center justify-center mb-14 hidden"
>
</div>
<% end %>
</div>

<div
Expand Down

0 comments on commit 1d75124

Please sign in to comment.