Skip to content

Commit 7c30f9a

Browse files
committed
add missing session check
1 parent f470358 commit 7c30f9a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/algora_web/controllers/oauth_callback_controller.ex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ defmodule AlgoraWeb.OAuthCallbackController do
3838

3939
:redirect ->
4040
conn = AlgoraWeb.UserAuth.put_current_user(conn, user)
41-
AlgoraWeb.Util.redirect_safe(conn, data[:return_to] || AlgoraWeb.UserAuth.signed_in_path(conn))
41+
42+
AlgoraWeb.Util.redirect_safe(
43+
conn,
44+
data[:return_to] || get_session(conn, :user_return_to) || AlgoraWeb.UserAuth.signed_in_path(conn)
45+
)
4246
end
4347
else
4448
{:error, reason} ->

0 commit comments

Comments
 (0)