Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Nov 6, 2018
1 parent a0a16e3 commit a30cab1
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions README.md
Expand Up @@ -4,15 +4,31 @@ Authlib Loginpass
Social connections powered by [Authlib][]. This library is a part of Authlib project.
It works well with Authlib v0.7+.

<a href="https://lepture.com/donate">
<img src="https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat" />
</a>
<a href="https://patreon.com/lepture">
<img src="https://img.shields.io/badge/I0-patreon-f96854.svg?maxAge=2592000&style=flat" />
</a>

[Authlib]: https://authlib.org/

<a href="https://lepture.com/donate"><img src="https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000" /></a>
<a href="https://patreon.com/lepture"><img src="https://img.shields.io/badge/I0-patreon-f96854.svg?maxAge=2592000" /></a>

```python
from flask import Flask
from authlib.flask.client import OAuth
from loginpass import create_flask_blueprint, GitHub

app = Flask(__name__)
oauth = OAuth(app)

def handle_authorize(remote, token, user_info):
if token:
save_token(remote.name, token)
if user_info:
save_user(user_info)
return user_page
raise some_error

github_bp = create_flask_blueprint(GitHub, oauth, handle_authorize)
app.register_blueprint(github_bp, url_prefix='/github')
```

Useful Links
------------

Expand Down

0 comments on commit a30cab1

Please sign in to comment.