---
title: "Discussion on \"How to protect route in ExpressJS using Passport\" | Hashnode"
description: "Discussion on \"How to protect route in ExpressJS using Passport\". This article explain how to make certain route only accessible if user is logged in. User json web token and passportjs as a guard"
url: "https://hashnode.com/posts/how-to-protect-route-in-expressjs-using-passport/6870d6bdd05a4b696fe160f7"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to protect route in ExpressJS using Passport](https://alexdoff.hashnode.dev/how-to-protect-route-in-expressjs-using-passport?utm_source=hashnode&utm_medium=feed)

This article explain how to make certain route only accessible if user is logged in. User json web token and passportjs as a guard

Jul 11, 2025 · 14 min read · alexdoff.hashnode.dev  
Read the article

-   [#passportjs](https://hashnode.com/tag/passportjs)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#authentication](https://hashnode.com/tag/authentication)

## Written by

[Alexander Septian Arfeprakosa](https://hashnode.com/@alexdoff)

@alexdoff

  
[View profile](https://hashnode.com/@alexdoff)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
