A pycord extension for Discord OAuth2 authentication in Quart applications.
Project description
pycord-quart
A pycord extension for Discord OAuth2 authentication in Quart applications.
Installation
Python >= 3.10.x is required.
# Windows
pip install --upgrade pycord-quart
# Linux
pip3 install --upgrade pycord-quart
Examples
from quart import Quart, request, session, redirect, url_for, jsonify
from pycord.ipc import Client
from pycord.quart import DiscordAuth, require_auth, get_current_user
app = Quart(__name__)
ipc_client = Client(secret_key=<"your IPCSecret">, host=<"your IPC Server IP">, port=<"your IPC Server Port">)
app.config["SECRET_KEY"] = <"your SecretKey">
discord_auth = DiscordAuth(
client_id=<"your DiscordClientID">,
client_secret=<"your DiscordClientSecret">,
redirect_uri=<"your DiscordRedirectURI">,
scopes=['identify', 'email', 'guilds'],
)
@app.route("/api/auth/login", methods=["GET"])
async def api_login():
response = await discord_auth.login_handler()
return jsonify(response.to_json), response.code
@app.route("/api/auth/callback", methods=["GET"])
async def api_callback():
response = await discord_auth.callback_handler()
return jsonify(response.to_json), response.code
@app.route("/api/auth/logout", methods=["POST"])
async def api_logout():
response = await discord_auth.logout_handler()
return jsonify(response.to_json), response.code
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8080, debug=True)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycord_quart-0.1.4.tar.gz.
File metadata
- Download URL: pycord_quart-0.1.4.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f3e996fa724d0eb196fcf255fa80e036ce2fb89a970be81dff9a59e15f4b7a3
|
|
| MD5 |
807efef187b6fbdca214703412f0871e
|
|
| BLAKE2b-256 |
6e5670f05c38f75a959c5b84558dea9e810dabc800e80ef33f4fb8ad78704023
|
Provenance
The following attestation bundles were made for pycord_quart-0.1.4.tar.gz:
Publisher:
publish.yml on ParrotXray/pycord-quart
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pycord_quart-0.1.4.tar.gz -
Subject digest:
1f3e996fa724d0eb196fcf255fa80e036ce2fb89a970be81dff9a59e15f4b7a3 - Sigstore transparency entry: 487170112
- Sigstore integration time:
-
Permalink:
ParrotXray/pycord-quart@03900036155b523542aa1bf4f34fbba29092935a -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/ParrotXray
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03900036155b523542aa1bf4f34fbba29092935a -
Trigger Event:
release
-
Statement type:
File details
Details for the file pycord_quart-0.1.4-py3-none-any.whl.
File metadata
- Download URL: pycord_quart-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48f6cf3a09aa476ed3b65f3f9d700fb23614a6e7f6fa13497456f2bb00d42367
|
|
| MD5 |
b5281f1371ce177ae1c99999a0c9e4ad
|
|
| BLAKE2b-256 |
dea95294bc0eb1048d66b6f23a321584cd098e6d3757d9e7d1ce84de066951d2
|
Provenance
The following attestation bundles were made for pycord_quart-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on ParrotXray/pycord-quart
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pycord_quart-0.1.4-py3-none-any.whl -
Subject digest:
48f6cf3a09aa476ed3b65f3f9d700fb23614a6e7f6fa13497456f2bb00d42367 - Sigstore transparency entry: 487170116
- Sigstore integration time:
-
Permalink:
ParrotXray/pycord-quart@03900036155b523542aa1bf4f34fbba29092935a -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/ParrotXray
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03900036155b523542aa1bf4f34fbba29092935a -
Trigger Event:
release
-
Statement type: