Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
idatg2204-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Steffen Martinsen
idatg2204-project
Commits
0497fa61
Commit
0497fa61
authored
1 year ago
by
Knut Fineid
Browse files
Options
Downloads
Patches
Plain Diff
remove unused, add logged in check
parent
b1401212
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Backend/main.py
+0
-1
0 additions, 1 deletion
Backend/main.py
Backend/routes/cart.py
+0
-8
0 additions, 8 deletions
Backend/routes/cart.py
Backend/routes/login.py
+5
-0
5 additions, 0 deletions
Backend/routes/login.py
with
5 additions
and
9 deletions
Backend/main.py
+
0
−
1
View file @
0497fa61
...
@@ -2,7 +2,6 @@ from utils.application import app
...
@@ -2,7 +2,6 @@ from utils.application import app
from
routes.category
import
get_category
from
routes.category
import
get_category
from
routes.home
import
get_home
from
routes.home
import
get_home
from
routes.order
import
post_create_order
,
pay_order
from
routes.order
import
post_create_order
,
pay_order
#from routes.cart import get_cart
from
routes.login
import
post_login
,
post_logout
,
post_register
from
routes.login
import
post_login
,
post_logout
,
post_register
from
routes.product
import
get_product_by_id
,
get_product_all
,
get_products_by_search
from
routes.product
import
get_product_by_id
,
get_product_all
,
get_products_by_search
...
...
This diff is collapsed.
Click to expand it.
Backend/routes/cart.py
deleted
100644 → 0
+
0
−
8
View file @
b1401212
from
main
import
mysql
,
jsonify
def
get_cart
():
cur
=
mysql
.
connection
.
cursor
()
cur
.
execute
(
''
)
# TODO Add SQL query here
data
=
cur
.
fetchall
()
cur
.
close
()
return
jsonify
(
data
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Backend/routes/login.py
+
5
−
0
View file @
0497fa61
...
@@ -9,6 +9,11 @@ def post_logout():
...
@@ -9,6 +9,11 @@ def post_logout():
return
response
return
response
def
post_login
():
def
post_login
():
# Make sure we are not already logged in to another user
userId
=
request
.
cookies
.
get
(
'
logged_in
'
)
if
userId
is
not
None
:
return
jsonify
({
"
message
"
:
"
A user is already logged in
"
}),
400
# Get data from request
# Get data from request
data
=
request
.
json
data
=
request
.
json
email
=
data
[
"
email
"
]
email
=
data
[
"
email
"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment