resuelve_auth v1.2.1 ResuelveAuth.Helpers.TokenHelper

Modulo para la generacion y verificacion de tokens JWT

Link to this section Summary

Functions

Genera un token usando un mapa. Retorna un token con el siguiente formato JSON_EN_BASE64_SEGURO_PARA_URLS.FIRMA_HMAC_SHA_256_EN_BASE_16

Verifica la firma y devuelve una mapa con los datos del token

Link to this section Functions

Link to this function

create_token(data, secret)

create_token(struct(), String.t()) :: String.t()

Genera un token usando un mapa. Retorna un token con el siguiente formato JSON_EN_BASE64_SEGURO_PARA_URLS.FIRMA_HMAC_SHA_256_EN_BASE_16

Link to this function

verify_token(token, secret)

verify_token(String.t(), String.t()) :: tuple()

Verifica la firma y devuelve una mapa con los datos del token