From b247cb958e723cbad71b9d1045124d3b3c9a7046 Mon Sep 17 00:00:00 2001 From: Jonas Leder <jonas@jonasled.de> Date: Sat, 9 Nov 2019 17:34:04 +0100 Subject: [PATCH] moved user management in /user (login, logout,...) --- docker-compose-build.yml | 2 +- docker-compose.yml | 2 +- main.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose-build.yml b/docker-compose-build.yml index 3a023a7..1b68a22 100644 --- a/docker-compose-build.yml +++ b/docker-compose-build.yml @@ -16,7 +16,7 @@ services: - recaptcha_private= #Please enter here your private Key for google recaptcha - recaptcha_public= #Please enter here your public Key for google recaptcha - host=0.0.0.0 #With this variable you can set the access ip range. 127.0.0.1 means you can only access it from the local network and 0.0.0.0 means everyone can access it. - - GITHUB_CLIENT_ID= #You have to set these two variables, if not the shorter will not run. To get the keys visit https://github.com/settings/developers and register a new oauth application. The callback path is /github-callback + - GITHUB_CLIENT_ID= #You have to set these two variables, if not the shorter will not run. To get the keys visit https://github.com/settings/developers and register a new oauth application. The callback path is /user/github-callback - GITHUB_CLIENT_SECRET= volumes: url_shorter_db: \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 750e071..9c1cb54 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: - recaptcha_public= #Please enter here your public Key for google recaptcha - host=0.0.0.0 #With this variable you can set the access ip range. 127.0.0.1 means you can only access it from the local network and 0.0.0.0 means everyone can access it. - host=0.0.0.0 #With this variable you can set the access ip range. 127.0.0.1 means you can only access it from the local network and 0.0.0.0 means everyone can access it. - - GITHUB_CLIENT_ID= #You have to set these two variables, if not the shorter will not run. To get the keys visit https://github.com/settings/developers and register a new oauth application. The callback path is /github-callback + - GITHUB_CLIENT_ID= #You have to set these two variables, if not the shorter will not run. To get the keys visit https://github.com/settings/developers and register a new oauth application. The callback path is /user/github-callback - GITHUB_CLIENT_SECRET= volumes: url_shorter_db: diff --git a/main.py b/main.py index 170e7c7..660de96 100644 --- a/main.py +++ b/main.py @@ -210,11 +210,11 @@ def redirect_short_url(short_url): abort(404) -@app.route('/login') +@app.route('/user/login') def login(): return github.authorize(scope="user") -@app.route('/github-callback') +@app.route('/user/github-callback') @github.authorized_handler def authorized(oauth_token): if oauth_token is None: @@ -230,7 +230,7 @@ def authorized(oauth_token): resp.set_cookie('username', username) return resp -@app.route('/logout') +@app.route('/user/logout') def logout(): resp = make_response("logout successfull") resp.set_cookie('userID', "", max_age=0) -- GitLab