---
title: "Discussion on \"Securing your HTML Page with JavaScript location.assign() Method\" | Hashnode"
description: "Discussion on \"Securing your HTML Page with JavaScript location.assign() Method\". Hello beautiful developers 👋.\nSometimes we might want to prevent the users from accessing a particular webpage on our website until they are either signed in or have completed a required step.\nWait!!! Let me show you what I mean 👇.\nUsing a dashboar..."
url: "https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82"
---

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

Discussion

# [Securing your HTML Page with JavaScript location.assign() Method](https://unclebigbay.hashnode.dev/securing-your-html-page-with-javascript-locationassign-method?utm_source=hashnode&utm_medium=feed)

Hello beautiful developers 👋. Sometimes we might want to prevent the users from accessing a particular webpage on our website until they are either signed in or have completed a required step. Wait!!! Let me show you what I mean 👇. Using a dashboar...

Aug 11, 2021 · 5 min read · unclebigbay.hashnode.dev  
Updated Dec 5, 2021  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#javascript-books](https://hashnode.com/tag/javascript-books)

## Written by

[Ayodele Samuel Adebayo](https://hashnode.com/@unclebigbay)

@unclebigbay · Nigeria

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

Software Engineer | Open-Source Contributor | Developer Educator

Software engineer and developer educator with over four years of experience building production-grade digital products for platforms serving millions of developers globally. Software engineer at Hashnode &amp; Bug0

## Responses 5

Markdown supported · ⌘↵ to post

[Suprabha Supi](https://hashnode.com/@suprabhasupi)

[Aug 13, 2021](https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82/comment/61162d1390eeb80f1ac0d2f4)

This is really amazing article 😍 I will definitely try this one, thanks for sharing 🔥

[Ayodele Samuel Adebayo](https://hashnode.com/@unclebigbay)

[Aug 13, 2021](https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82/comment/61162d1390eeb80f1ac0d2f4#reply-6116664913a99e48922ee907)

You're welcome [Suprabha Supi](https://hashnode.com/@suprabhasupi)

Glad you found it useful, and thanks for the kind words. 🤗

[victor josiah](https://hashnode.com/@Jovick-coder)

[Aug 11, 2021](https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82/comment/6114110d611d5c199a2fade9)

It is awesome

[Ayodele Samuel Adebayo](https://hashnode.com/@unclebigbay)

[Aug 11, 2021](https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82/comment/6114110d611d5c199a2fade9#reply-6114198b119030192497a698)

thanks [victor josiah](https://hashnode.com/@Vic-coder)

[Rahul Kumar](https://hashnode.com/@rahuldsabyte)

[Aug 11, 2021](https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82/comment/6113b1ce5f85bc2b3d11fa13)

Hi, do you know user can also access your page if they are not authenticated?

They can easily disable `JS` and ...umma.

[Ayodele Samuel Adebayo](https://hashnode.com/@unclebigbay)

[Aug 11, 2021](https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82/comment/6113b1ce5f85bc2b3d11fa13#reply-6113b37e5f85bc2b3d11fa55)

If you disabled JS to get to the dashboard.

How will you get the dashboard features to work??? 🤷‍♂️

[Ayodele Samuel Adebayo](https://hashnode.com/@unclebigbay)

[Aug 11, 2021](https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82/comment/6113b1ce5f85bc2b3d11fa13#reply-61141979119030192497a68f)

[Atanas Hristov](https://hashnode.com/@ahristov) and [Olubisi Idris Ayinde](https://hashnode.com/@olanetsoft)

please do you have anything to say to this? 🙏

[Otman Bouchari](https://hashnode.com/@Obouchari)

[Aug 12, 2021](https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82/comment/6113b1ce5f85bc2b3d11fa13#reply-6114b141119030192497aed4)

[Ayodele Samuel Adebayo](https://hashnode.com/@unclebigbay) This is not a security measure to rely on, but it is helpful when you have a SPA and don't want to redirect using the server. I think React router under the hood uses such functionality, but you definitely don't want to expose the state of your web app, only the layout!

[Victor Eke](https://hashnode.com/@Eke)

[Aug 11, 2021](https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82/comment/611383fa129f075406bd71b5)

This will definitely come in handy. Nice one boss. 💯

[Ayodele Samuel Adebayo](https://hashnode.com/@unclebigbay)

[Aug 11, 2021](https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82/comment/611383fa129f075406bd71b5#reply-6113860d756897544b106340)

Thanks a lot

Glad you found it helpful

[George Isiguzo Chinonye](https://hashnode.com/@Georgie)

[Aug 11, 2021](https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82/comment/611376b62485287288b72404)

An informative article. Keep up the good work UncleBigBay 🙌

[Ayodele Samuel Adebayo](https://hashnode.com/@unclebigbay)

[Aug 11, 2021](https://hashnode.com/posts/securing-your-html-page-with-javascript-locationassign-method/61136ff5c0623972de8a6f82/comment/611376b62485287288b72404#reply-6113772a2485287288b72435)

Yah!!! Thanks a lot for the kind words, sure I will.

Glad you found it helpful
