From 64814a979e979b702a72df706b278c5f91772772 Mon Sep 17 00:00:00 2001 From: Luna Date: Sat, 19 Jan 2019 16:38:07 -0300 Subject: [PATCH] auth: add POST /api/v6/auth/fingerprint --- litecord/blueprints/auth.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/litecord/blueprints/auth.py b/litecord/blueprints/auth.py index 28eccd5..f61a801 100644 --- a/litecord/blueprints/auth.py +++ b/litecord/blueprints/auth.py @@ -18,6 +18,7 @@ along with this program. If not, see . """ import base64 +import secrets import itsdangerous import bcrypt @@ -26,6 +27,7 @@ from quart import Blueprint, jsonify, request, current_app as app from litecord.auth import token_check, create_user from litecord.schemas import validate, REGISTER, REGISTER_WITH_INVITE from litecord.errors import BadRequest +from litecord.snowflake import get_snowflake from .invites import use_invite @@ -170,3 +172,14 @@ async def verify_user(): async def _logout(): """Called by the client to logout.""" return '', 204 + + +@bp.route('/fingerprint', methods=['POST']) +async def _fingerprint(): + """No idea what this route is about.""" + fingerprint_id = get_snowflake() + fingerprint = f'{fingerprint_id}.{secrets.token_urlsafe(32)}' + + return jsonify({ + 'fingerprint': fingerprint + })