> For the complete documentation index, see [llms.txt](https://w3auth.devzstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://w3auth.devzstudio.com/external-backend.md).

# 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
