Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
mini-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 86e30aa3
authored
2019-12-16 14:28:49 +0000
by
Luciano Barletta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added a session delete
1 parent
2fb27c0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
app.py
validation.py
app.py
View file @
86e30aa
...
...
@@ -121,5 +121,14 @@ def ivalidate():
return
aux
.
validate
(
data
)
@app.route
(
'/remove-session'
,
methods
=
[
'POST'
])
def
removesession
():
try
:
validation
=
Validation
()
validation
.
remove_roken
(
request
.
json
)
aux
.
answer
(
True
)
except
:
aux
.
answer
(
False
,
"Error borrando sesión"
)
if
__name__
==
"__main__"
:
app
.
run
(
"0.0.0.0"
)
\ No newline at end of file
validation.py
View file @
86e30aa
...
...
@@ -35,6 +35,9 @@ QWERTYUIOPASDFGHJKLZXCVBNM\
def
check_token
(
self
,
token
):
return
token
in
self
.
data
def
remove_token
(
self
,
token
)
self
.
data
.
discard
(
token
)
def
__del__
(
self
):
with
open
(
self
.
FILE
,
"+w"
)
as
f
:
f
.
write
(
json
.
dumps
(
list
(
self
.
data
)))
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment