Skip to content

Instantly share code, notes, and snippets.

@twyle
Created June 2, 2022 12:36
Show Gist options
  • Save twyle/8e1f9e98722a3421ac320e92d0a4f5af to your computer and use it in GitHub Desktop.
Save twyle/8e1f9e98722a3421ac320e92d0a4f5af to your computer and use it in GitHub Desktop.
# -*- 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