File size: 520 Bytes
eb0b2fd
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import requests
import url64
from config import CONFIG

def get_id_cliente_reciclador(token: str) -> int | None:
    try:
        jwt = url64.decode(token) # (token + "==="), Refer to: https://gist.github.com/perrygeo/ee7c65bb1541ff6ac770
        res = requests.post(CONFIG.AUTH_URL, json={ "authToken": jwt})
        print("[AUTH] Status:", res.status_code)
        if res.status_code == 200:
            return res.json().get("idClienteReciclador", None)
    except Exception as e:
        print(e)
        return None