Skip to content

Commit

Permalink
fix: App Adapter Guard (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-martinez authored Apr 4, 2024
1 parent 39dfc13 commit b0d3939
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/lenra_web/lib/lenra_web/app_adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ defmodule LenraWeb.AppAdapter do
}),
do: true

def authorize(:join_app, user, app) when not is_nil(user) do
def authorize(:join_app, nil, _app), do: false

def authorize(:join_app, user, app) do
case Apps.fetch_user_env_access(
environment_id: app.main_env.environment.id,
user_id: user.id
Expand Down

0 comments on commit b0d3939

Please sign in to comment.