From fe5e036c3ee727ede1585c53ab0536b32763e264 Mon Sep 17 00:00:00 2001 From: Maygician Date: Mon, 5 Oct 2020 20:05:30 +0700 Subject: [PATCH] minor template changes --- deploy/rel.sh | 3 ++- lp/lib/lp_web/controllers/git_controller.ex | 10 ++++++---- lp/lib/lp_web/templates/git/oauth2.html.eex | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/deploy/rel.sh b/deploy/rel.sh index 0f1f169..6fcea27 100644 --- a/deploy/rel.sh +++ b/deploy/rel.sh @@ -8,7 +8,8 @@ key=`mix phx.gen.secret` echo 'export SECRET_KEY_BASE='$key >> ~/.bashrc fi if [ -z "$PORT"]; then -echo 'export PORT=443' >> ~/.bashrc +echo 'export PORT=80' >> ~/.bashrc +# echo 'export PORT=443' >> ~/.bashrc that was a mistake. it is http port in prod fi # and cert paths if [ -z "$GCLP_SSL_KEY_PATH"]; then diff --git a/lp/lib/lp_web/controllers/git_controller.ex b/lp/lib/lp_web/controllers/git_controller.ex index 76dc9c1..5a716e3 100644 --- a/lp/lib/lp_web/controllers/git_controller.ex +++ b/lp/lib/lp_web/controllers/git_controller.ex @@ -10,9 +10,11 @@ defmodule LpWeb.GitController do def show(conn, _params) do html(conn,"") end - def oauth(conn, _params) do - # render(conn, "oauth2.html") - redirect(conn, "git.html") + def oauth(conn, %{"code" => code}) do + render(conn, "oauth2.html", code: code) + # redirect(conn, "git.html") + html(conn,"") + end def github(conn, _params) do authorize_url = Github.Oauth2.Client.authorize_url!( @@ -22,4 +24,4 @@ defmodule LpWeb.GitController do ) conn |> redirect(external: authorize_url) end - end \ No newline at end of file + end diff --git a/lp/lib/lp_web/templates/git/oauth2.html.eex b/lp/lib/lp_web/templates/git/oauth2.html.eex index 9ecd5d0..411d54c 100644 --- a/lp/lib/lp_web/templates/git/oauth2.html.eex +++ b/lp/lib/lp_web/templates/git/oauth2.html.eex @@ -1,2 +1,3 @@

Autorisation succeded

-todo. keep context \ No newline at end of file +Your key is: <%= @code %>! +todo. keep context