utils

package
v0.0.0-...-95d0b56 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2021 License: ISC Imports: 3 Imported by: 0

Documentation

Overview

Source code taken from: https://stackoverflow.com/a/22892986

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJWTTokenPair

func GenerateJWTTokenPair(hmacSecret []byte, sessionUuid string, d time.Duration) (string, string, error)

Generate the `access token` and `refresh token` for the secret key.

func NewRandomString

func NewRandomString(n int) string

func ProcessBearerToken

func ProcessBearerToken(hmacSecret []byte, reqToken string) (string, error)

Validates either the `access token` or `refresh token` and returns either the `uuid` if success or error on failure.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL