Skip to content
Snippets Groups Projects
Commit ebe4830c authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Get redir from query string

parent 0ded9be2
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ...@@ -13,6 +13,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
const DEBUG = true; const DEBUG = true;
// use REMOTE_USER for production // use REMOTE_USER for production
const username = 'louistw'; const username = 'louistw';
const params = new URLSearchParams(window.location.search);
const redir_url = params.get('redir') || '/pun/sys/dashboard';
function Main(props) { function Main(props) {
// Setup states // Setup states
...@@ -78,8 +80,8 @@ function Main(props) { ...@@ -78,8 +80,8 @@ function Main(props) {
clearTimeout(myTimer); clearTimeout(myTimer);
})() })()
setTimeout(() => { setTimeout(() => {
if (DEBUG) console.log('Redirecting to /test') if (DEBUG) console.log('Redirecting to ' + redir_url)
window.location = '/test'; window.location = redir_url;
}, sec * 1000); }, sec * 1000);
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment