Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 674 Bytes

README.md

File metadata and controls

30 lines (18 loc) · 674 Bytes

SoAuth Py

Python middleware for SoAuth.

See https://soauth.sojs.repl.co

Installation

pip install soauth

Usage

Import the module into your project:

from soauth import soauth

Then, use it as middlewarefor your express app:

app = Flask(__name__)
app.before_request(soauth)

This will run the soauth function before every request, checking for the so-auth cookie and validating the user. If the cookie is present and valid, the user data will be stored in the session under session['so_auth']['user']. If the cookie is not present or is invalid, session['so_auth']['user'] will be set to False.