Skip to content
Snippets Groups Projects
Commit 2a35f035 authored by Jonas Leder's avatar Jonas Leder
Browse files

added page if you access /user/login

parent 1bb55a84
Branches
Tags
No related merge requests found
Pipeline #70 canceled
......@@ -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():
......
<!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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment