From 2a35f035038291278baeb4f0f2a05544d0d32e4c Mon Sep 17 00:00:00 2001 From: jonasled <jonas@jonasled.de> Date: Mon, 11 Nov 2019 07:48:03 +0100 Subject: [PATCH] added page if you access /user/login --- main.py | 2 +- templates/login.html | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 templates/login.html diff --git a/main.py b/main.py index 884c442..268e364 100644 --- a/main.py +++ b/main.py @@ -222,7 +222,7 @@ def login(): service = request.args.get("service") if(service == "github"): return redirect("https://github.com/login/oauth/authorize/?client_id=" + GITHUB_CLIENT_ID + "&scope=user") #redirect the user to the github login page and ask for access to user data (name, email, ...) if(service == "google"): return redirect("https://accounts.google.com/o/oauth2/v2/auth?client_id=" + GOOGLE_CLIENT_ID + "&scope=profile%20email%20openid&response_type=code&access_type=offline&include_granted_scopes=true&redirect_uri=" + url_scheme + "://" + domain[0] + "/user/google-callback") - abort(404) + return render_template("login.html", cookieNotice=cookieNotice) @app.route("/user/google-callback") def authorizeGoogle(): diff --git a/templates/login.html b/templates/login.html new file mode 100644 index 0000000..917e44f --- /dev/null +++ b/templates/login.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <link href="/static/style.css" rel="stylesheet"> + <link href="/static/socialSignin/css/buttons-si.css" rel="stylesheet"> + {% if cookieNotice %} + <script type="text/javascript" id="cookieinfo" src="/static/cookieinfo.js" ></script> + {% endif %} + <title>URL shorter</title> + </head> + + <body> + <div class="login-page"> + <div class="form"> + <div class="box box-a"> + <a class="btn-si btn-si-a btn-github" style="color: white;" href="/user/login?service=github">Sign in with GitHub </a><br><br><br><br> + <a class="btn-si btn-si-a btn-google" style="color: white;"href="/user/login?service=google">Sign in with Google</a> + </div> + </div> + </div> + + <script src="/static/external/jquery/jquery.js"></script> + </body> +</html> \ No newline at end of file -- GitLab