Skip to content

Commit

Permalink
Fix errors after rebasing this branch
Browse files Browse the repository at this point in the history
  • Loading branch information
iltenahmet committed Feb 25, 2024
1 parent 46b723f commit 75d19ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
20 changes: 5 additions & 15 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,17 @@
print("Connected to MongoDB!")
except Exception as e:
print("MongoDB connection error:", e)

@app.route("/")
def home():
# Note: (Ahmet) I will do these
# TODO: redirect to login
# TODO: redirect to sign up
return render_template('start.html')

@app.route("/login", methods=["GET", "POST"])
def login():
# would get form fields
# would check if correct username and password
return render_template('login.html')

@app.route("/signup", methods=["GET", "POST"])
def signup():
#would add user to db
#would redirect to template for login
return render_template('signup.html')

app.add_url_rule('/login', view_func=authentication.login)
app.add_url_rule('/signup', view_func=authentication.signup)
# Handle authentication related stuff in authentication.py file
app.add_url_rule('/login', methods=["GET", "POST"], view_func=authentication.login)
app.add_url_rule('/signup', methods=["GET", "POST"], view_func=authentication.signup)

@app.route("/<username>/decks")
def allDecks(username):
Expand Down
2 changes: 1 addition & 1 deletion authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ def login():
def signup():
return render_template('signup.html')


# TODO: Handle autehentication and session management with flask-login

0 comments on commit 75d19ad

Please sign in to comment.