Diagram
  • Introduction
  • Get Started
    • Hello World
    • Connecting to a DB
    • From a template
  • Concepts
    • Endpoints
    • Algorithm
  • Nodes
    • Bcrypt
    • Code
    • Constant
    • Database
    • EasyDB
    • Firestore
    • If / Then
    • Request
    • Response
    • JWT
    • Mapper
    • MongoDB
    • Stripe
    • Webhook
  • Templates
    • Login
    • Register
    • Get User
  • Resources
    • Dashboard
    • Contact
    • FAQs
Powered by GitBook
On this page
  • General
  • Input
  • Output
  • Use Cases

Was this helpful?

  1. Nodes

JWT

PreviousResponseNextMapper

Last updated 3 years ago

Was this helpful?

General

The Jwt node can be used to encrypt an object to JSON web token or similarly to decrypt one to an object.

Input

Case: SIGN

  • Source: Receives an Object with the values to encrypt. Learn more on .

Case: VERIFY

  • Source: Receives the JSON web token as String. Learn more on .

Environment variables:

  • jwt: Requires JWT PRIVATE KEY to be set.

Output

Case: SIGN

  • Out: Returns a String with the encrypted JWT. Learn more on .

Case: VERIFY

  • Out: Returns a Boolean true if the token is valid and false if it's invalid. Learn more on .

Use Cases

Register a user to a database.

  • Request (Post) ➡ Jwt (Sign) ➡ Database (Add) ➡ Response (200)

Return a user's profile.

  • Request (Get) ➡ Jwt (verify) ➡ Database (Get) ➡ Response (200)

jwt.sign
jwt.sign
jwt.sign
jwt.sign