Compare commits
No commits in common. "e4fdbd81b040dcad52b35ce4f9c8c85b2f573e73" and "4a15e9a2fa4f0f022c193e05f2e90f99ba98c337" have entirely different histories.
e4fdbd81b0
...
4a15e9a2fa
@ -4,7 +4,7 @@ host = "localhost"
|
|||||||
port = 11000
|
port = 11000
|
||||||
reloader = True
|
reloader = True
|
||||||
debug = False
|
debug = False
|
||||||
server = 'paste' # try 'gunicorn'
|
server = 'wsgiref' # try 'gunicorn'
|
||||||
|
|
||||||
session_opts = {
|
session_opts = {
|
||||||
'session.type': 'file',
|
'session.type': 'file',
|
||||||
|
13
handler.py
13
handler.py
@ -6,10 +6,9 @@
|
|||||||
# You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
|
# You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
|
||||||
from bottle import Bottle, route, request, response, redirect
|
from bottle import Bottle, route, request, response, redirect
|
||||||
from config import directory, globalvar
|
from config import directory
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import requests
|
|
||||||
|
|
||||||
import templates.plain.main as template_public
|
import templates.plain.main as template_public
|
||||||
import templates.postcard.main as template_email
|
import templates.postcard.main as template_email
|
||||||
@ -100,14 +99,8 @@ def index():
|
|||||||
"jwt" : beaker_session["token"],
|
"jwt" : beaker_session["token"],
|
||||||
"type" : "out"
|
"type" : "out"
|
||||||
}
|
}
|
||||||
print("Remove token from database")
|
response_session = api_auth.auth().session(params)
|
||||||
requests_headers = {
|
response_logout = api_auth.auth().logout(params)
|
||||||
"Authorization": f"Bearer {params['jwt']}"
|
|
||||||
}
|
|
||||||
requests_callback = requests.post(f'{globalvar.baseurl}/api/auth/logout', headers=requests_headers)
|
|
||||||
response_logout = requests_callback.json()
|
|
||||||
print("Remove token from beaker")
|
|
||||||
response_session = api_auth.auth().session(params)
|
|
||||||
if response_session['status'] == 'success' and response_logout['status'] == 'success' :
|
if response_session['status'] == 'success' and response_logout['status'] == 'success' :
|
||||||
redirect('/?message=logout success')
|
redirect('/?message=logout success')
|
||||||
else:
|
else:
|
||||||
|
@ -4,7 +4,6 @@ python3 -m venv .venv # Create .venv
|
|||||||
|
|
||||||
.venv/bin/pip3 install bottle # Micro Framework
|
.venv/bin/pip3 install bottle # Micro Framework
|
||||||
.venv/bin/pip3 install gunicorn # WSGI Server Backend
|
.venv/bin/pip3 install gunicorn # WSGI Server Backend
|
||||||
.venv/bin/pip3 install paste # WSGI Server Backend that support circular call
|
|
||||||
.venv/bin/pip3 install beaker # Session & caching library
|
.venv/bin/pip3 install beaker # Session & caching library
|
||||||
.venv/bin/pip3 install mako # Template library
|
.venv/bin/pip3 install mako # Template library
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user