diff --git a/src/tjts5901/auth.py b/src/tjts5901/auth.py index adce70dad4db8ac8ca9461ea2f1213fb9ab7440a..83d272cfe04cfe6576433f614a542233cbc2a290 100644 --- a/src/tjts5901/auth.py +++ b/src/tjts5901/auth.py @@ -180,7 +180,7 @@ def login(): # Better check that the user actually clicked on a relative link # or else they could redirect you to a malicious website! if next is None or not next.startswith('/'): - next = url_for('views.index') + next = url_for('views.list_bid') return redirect(next) else: @@ -202,7 +202,7 @@ def logout(): """ logout_user() flash("You have been logged out.") - return redirect(url_for('views.index')) + return redirect(url_for('auth.login')) @bp.route('/profile', defaults={'email': 'me'}) diff --git a/src/tjts5901/templates/base.html b/src/tjts5901/templates/base.html index 90620a4fffab7b030b9c7659f25542a0ac9c3ca4..f6b87e4738bf4d39be8a8fd2858aa47812f9b13c 100644 --- a/src/tjts5901/templates/base.html +++ b/src/tjts5901/templates/base.html @@ -12,7 +12,7 @@ <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}"> <nav class="navbar navbar-expand-lg navbar-dark bg-dark"> - <a class="navbar-brand" href="{{url_for('views.index')}}">{{config['BRAND']}}</a> + <a class="navbar-brand" href="{{url_for('views.list_bid')}}">{{config['BRAND']}}</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> diff --git a/src/tjts5901/views.py b/src/tjts5901/views.py index 5c9807a1408b0bfe16128df43cb4e88fa111a75a..72d2389bc62d06a7e931b1e24ae2a54d7edd275b 100644 --- a/src/tjts5901/views.py +++ b/src/tjts5901/views.py @@ -65,18 +65,6 @@ def get_item_price(item: Item) -> int: return item.starting_bid -@bp.route("/") -def index() -> str: - """ - Index page. - - """ - - # Render template file. Template file is using Jinja2 syntax, and can be passed an arbitrary number - # of arguments to be used in the template. The template file is located in the templates directory. - html = render_template("index.html.j2", title="TJTS5901 Example. It was changed by Arno.") - return html - @bp.route("/test") def test_item_adding(): """ @@ -155,6 +143,7 @@ def add_item(): return item +@bp.route("/") @bp.route("/listBid") @login_required def list_bid():