Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 826 Bytes

README.md

File metadata and controls

13 lines (10 loc) · 826 Bytes

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.