File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
services/app/apps/codebattle/lib/codebattle_web/controllers Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -13,18 +13,22 @@ defmodule CodebattleWeb.AuthController do
1313 url = Application . get_env ( :codebattle , :force_redirect_url , "/" )
1414
1515 url =
16- if url == "" do
16+ if url in [ nil , "" ] do
1717 "/"
1818 else
1919 url
2020 end
2121
22+ Logger . info ( "Redirecting to #{ url } " )
23+
2224 conn
2325 |> put_flash ( :info , gettext ( "Successfully authenticated" ) )
2426 |> put_session ( :user_id , user . id )
2527 |> redirect ( to: url )
2628
2729 { :error , reason } ->
30+ Logger . error ( "Failed to authenticate user: #{ inspect ( reason ) } " )
31+
2832 if url = Application . get_env ( :codebattle , :guest_user_force_redirect_url ) do
2933 conn
3034 |> redirect ( external: url )
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ defmodule CodebattleWeb.SessionController do
88 Application . get_env ( :codebattle , :use_only_token_auth ) ->
99 render ( conn , "token_only.html" )
1010
11- Application . get_env ( :codebattle , :use_local_password_auth ) || true ->
11+ Application . get_env ( :codebattle , :use_local_password_auth ) ->
1212 render ( conn , "local_password.html" )
1313
1414 :default ->
You can’t perform that action at this time.
0 commit comments