Skip to content

aanfarhan/redirector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Redirector.js

This little thing is to check if your current url need to be automatically redirected to authentication URL.

Installation

  1. Include redirector.min.js to your html page:
<script src="https://cdn.jsdelivr.net/gh/aanfarhan/redirector@main/redirector.min.js" redirect-url="YOUR_AUTHENTICATED_ENDPOINT" redirect-interval="INTERVAL_CHECKING_TIME"></script>
  1. Replace YOUR_AUTHENTICATED_ENPOINT with your url that only accessible when user authenticated, default value is '' which means your base url, for example https://example.com, so if you want to specify custom url it would be '/your-custom-url'.
  2. Replace INTERVAL_CHECKING_TIME with numeric value in miliseconds, default value is 60000 (60 seconds).
  3. Your page automatically redirected if your auth session no longer valid.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published