Skip to content

Instantly share code, notes, and snippets.

@PaperNick
PaperNick / auth0-verify.js
Last active August 17, 2022 19:21 — forked from westmark/auth0-verify.js
Auth0 JWT Verification
/**
* The MIT License (MIT)
* Copyright (c) 2022 PaperNick
*
* Resouces used:
* https://github.com/auth0/node-jwks-rsa
* https://github.com/auth0/node-jsonwebtoken
* https://auth0.com/blog/navigating-rs256-and-jwks/
* https://gist.github.com/westmark/faee223e05bcbab433bfd4ed8e36fb5f
* https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/
@PaperNick
PaperNick / django_choices_enum.py
Last active April 8, 2019 13:44 — forked from treyhunner/choice_enum.py
Enum for use with Django ChoiceField
from enum import Enum, EnumMeta, IntEnum, unique
def not_callable_in_template(cls):
"""Disable the callable behavior of Enum in django templates"""
cls.do_not_call_in_templates = True
return cls
class ChoiceEnumMeta(EnumMeta):