Created
June 2, 2022 12:36
-
-
Save twyle/8e1f9e98722a3421ac320e92d0a4f5af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module contains the routes associated with the auth Blueprint.""" | |
import os | |
from flask_dance.contrib.github import make_github_blueprint | |
from flask_dance.consumer.storage.sqla import SQLAlchemyStorage | |
from flask_login import current_user | |
from .models import OAuth | |
from ..extensions import db | |
auth = make_github_blueprint( | |
client_id=os.getenv('CLIENT_ID'), | |
client_secret=os.getenv('CLIENT_SECRET'), | |
storage=SQLAlchemyStorage( | |
OAuth, | |
db.session, | |
user=current_user, | |
user_required=False, | |
), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment