Skip to content

Commit

Permalink
OAuth - Update Routes
Browse files Browse the repository at this point in the history
  • Loading branch information
app-generator committed Sep 16, 2022
1 parent cb0e850 commit b591517
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apps/authentication/routes.py
Expand Up @@ -10,6 +10,8 @@
logout_user
)

from flask_dance.contrib.github import github

from apps import db, login_manager
from apps.authentication import blueprint
from apps.authentication.forms import LoginForm, CreateAccountForm
Expand All @@ -23,6 +25,15 @@ def route_default():

# Login & Registration

@blueprint.route("/github")
def login_github():
""" Github login """
if not github.authorized:
return redirect(url_for("github.login"))

res = github.get("/user")
return redirect(url_for('home_blueprint.index'))

@blueprint.route('/login', methods=['GET', 'POST'])
def login():
login_form = LoginForm(request.form)
Expand Down

0 comments on commit b591517

Please sign in to comment.