Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Unauthorized errors #253

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,13 @@ def apidocs():


@app.route('/about')
@requires_login
def about():
return render_template('about.html', title='About')
return render_template('about.html', title='About', unauthenticated=(not g.user))


@app.route('/faq')
def faq():
return render_template('faq.html', title='FAQ')
return render_template('faq.html', title='FAQ', unauthenticated=(not g.user))


@app.route('/hide_me')
Expand Down
2 changes: 2 additions & 0 deletions app/templates/401.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% set unauthenticated = True %}

{% block content %}
<h1>You don't have access to this page.</h1>
<p><a href="{{ url_for('index') }}">Home</a></p>
Expand Down
2 changes: 2 additions & 0 deletions app/templates/403.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% set unauthenticated = True %}

{% block content %}
<h1>Sorry, you don't have access to this page.</h1>
<p>For security reasons, you must be verifiably listed in the Yale directory as an undergraduate in order to access Yalies, CourseTable, and other YCS projects. If you are in the directory but are still seeing this message, please email <a href="mailto:[email protected]">[email protected]</a> for help.</p>
Expand Down
2 changes: 2 additions & 0 deletions app/templates/404.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% set unauthenticated = True %}

{% block content %}
<h1>Not found.</h1>
<p><a href="{{ url_for('index') }}">Home</a></p>
Expand Down
2 changes: 2 additions & 0 deletions app/templates/500.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% set unauthenticated = True %}

{% block content %}
<h1>An unexpected error has occurred.</h1>
<p><a href="{{ url_for('index') }}">Home</a></p>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
<a class="button outline" href="/">Home</a>
<a class="button outline" href="/about">About</a>
<a class="button outline" href="/faq">FAQ</a>
<a class="button outline" href="/apidocs">API</a>
{% if not unauthenticated %}
<a class="button outline" href="/apidocs">API</a>
<a class="button outline" href="/logout/">Log out</a>
{% endif %}
</nav>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/splash.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% block content %}
<h3>A better directory of the student body!</h3>
<p>Yalies is a redesigned version of Yale's official <a href="https://students.yale.edu/facebook">Face Book</a>, which provides contact information for Yale students. It displays data from the Face Book and <a href="https://directory.yale.edu">Yale Directory</a>, but through a more modern, better designed, and more secure interface. Unlike official Yale sources, Yalies is accessible only to undergraduates, and censors private details that we believe Yale should not divulge. Learn how to remove your data from Yale's official sources <a href="faq">here</a>.</p>
<p>Yalies also provides an <a href="/apidocs">API</a> for student developers. The API powers numerous student projects and university services, including <a href="https://coursetable.com">CourseTable</a>, <a href="https://yalemenus.com">Yale Menus</a>, <a href="https://rdb.yale.edu">Yale Research Database (RDB)</a>, <a href="https://yaledailynews.com/blog/2020/12/03/40-2-percent-of-returning-student-athletes-take-leaves-of-absence-this-fall">Yale Daily News</a>, <a href="https://yalies.me">Yalies.me</a>, <a href="https://mailyale.com">MailYale</a>, <a href="https://comethru.io">Comethru</a>, <a href="https://ypost.app">YPost</a>, <a href="https://github.com/ErikBoesen/yale">yale CLI</a>, <a href="https://yaledailynews.com/blog/2021/02/11/ship-lets-yalies-play-matchmaker-with-peers">Ship</a>, <a href="https://www.internships.yesatyale.org/">YES Internships</a>, </a>students in S&DS 315 and CPSC 490, and more.</p>
<p>Yalies also provides an API for student developers. The API powers numerous student projects and university services, including <a href="https://coursetable.com">CourseTable</a>, <a href="https://yalemenus.com">Yale Menus</a>, <a href="https://rdb.yale.edu">Yale Research Database (RDB)</a>, <a href="https://yaledailynews.com/blog/2020/12/03/40-2-percent-of-returning-student-athletes-take-leaves-of-absence-this-fall">Yale Daily News</a>, <a href="https://yalies.me">Yalies.me</a>, <a href="https://mailyale.com">MailYale</a>, <a href="https://comethru.io">Comethru</a>, <a href="https://ypost.app">YPost</a>, <a href="https://github.com/ErikBoesen/yale">yale CLI</a>, <a href="https://yaledailynews.com/blog/2021/02/11/ship-lets-yalies-play-matchmaker-with-peers">Ship</a>, <a href="https://www.internships.yesatyale.org/">YES Internships</a>, </a>students in S&DS 315 and CPSC 490, and more.</p>
<p>Yalies is maintained by the <a href="http://yalecompsociety.org">Yale Computer Society</a>.</p>
<a class="button" href="/login/">Log in with CAS</a>
{% endblock %}