View Source GuardianRedis.Adapter (GuardianRedis v0.2.0)

An adapter for Guardian.DB that uses Redis.

Serves only Guardian.DB purpose, do not use it as a Redis adapter for your project.

Dependant on Jason and Redix.

Stores and deletes JWT token to/from Redis using key combined from JWT.jti and JWT.aud.

Module stores JWT token in Redis using automatic expiry feature of Redis so we don't need to run token sweeper.

Summary

Functions

Remove a user token, log out functionality, invalidation of a JWT token.

Remove all tokens that belong to given sub.

Insert Token into Redis.

Fetches a single result from the query.

Mock implementation as Redis has built in key expiration that is in use.

Functions

Remove a user token, log out functionality, invalidation of a JWT token.

Link to this function

delete_by_sub(sub, opts)

View Source

Remove all tokens that belong to given sub.

Insert Token into Redis.

Token is auto expired in expired_in seconds based on JWT exp value.

Fetches a single result from the query.

Returns nil if no result was found. Raises if more than one entry.

Link to this function

purge_expired_tokens(timestamp, opts)

View Source

Mock implementation as Redis has built in key expiration that is in use.