linkr/varo_auth.py
Nathan Woodburn 79b210c8a7
All checks were successful
Build Docker / Build Main Image (push) Successful in 33s
feat: Initial code push
2023-11-17 00:06:02 +11:00

22 lines
513 B
Python

import requests
import json
def flask_login(request):
dict = request.form.to_dict()
keys = dict.keys()
keys = list(keys)[0]
keys = json.loads(keys)
auth_request = keys['request']
return login(auth_request)
def login(request):
r = requests.get(f'https://auth.varo.domains/verify/{request}')
r = r.json()
if r['success'] == False:
return False
if 'data' in r:
data = r['data']
if 'name' in data:
return data['name']
return False