Skip to content

Commit

Permalink
Change app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TomacGG committed Sep 10, 2024
1 parent 523f847 commit 4085f01
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions content/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from flask import Flask, request, redirect, make_response, Response
from flask import Flask, request, redirect, make_response
import sqlite3
import urllib
import html
import quoter_templates as templates

# Run using `poetry install && poetry run flask run --reload`
Expand Down Expand Up @@ -33,8 +32,7 @@ def check_authentication():
@app.route("/")
def index():
quotes = db.execute("select id, text, attribution from quotes order by id").fetchall()

return Response(quotes, request.user_id, request.args.get('error'))
return templates.main_page(quotes, request.user_id, request.args.get('error'))


# The quote comments page
Expand Down Expand Up @@ -106,7 +104,7 @@ def signin():
user_id = cursor.lastrowid

response = make_response(redirect('/'))
response.set_cookie('user_id', str(user_id))
response.set_cookie('user_id', str(user_id), secure=True, httponly=True, samesite='Lax')
return response


Expand Down

0 comments on commit 4085f01

Please sign in to comment.