🔐
w3auth
  • Welcome!
  • Installing
  • CORS
  • Authentication Flow
  • Integration Example
  • KYC
  • External Backend
  • API Reference
    • Active Chains
    • Nonce
    • Verify nonce
    • Link Wallet
    • Unlink Wallet
    • Profile & Custom fields
    • Logout
  • Package
    • React JS
  • Connect API
    • Enable API
    • User details
    • Allowlist Address
    • Blocklist Address
    • Get Settings
    • NFT Gating
    • Token Gating
Powered by GitBook
On this page

External Backend

You can validate the JWT token to determine whether the user has been authenticated if you are using an external backend.

import { verify } from 'jsonwebtoken'

const validateJWT = () => {
    const authorization = req.headers["authorization"]
    
    if (!authorization) throw new Error("not authenticated")
    const token = authorization.split(" ")[1]
    
    verify(token, process.env.JWT_SECRET);
}

To validate the token, you must use the same JWT Secret.

You can use connect API to get additional data from w3auth

PreviousKYCNextActive Chains

Last updated 2 years ago