Force Kibana to reload when user re-logs

There was an invalid reference to reload.markup.
Changed to use RELOAD_MARKUP from const.js
Bug-Id: 13131

Change-Id: I808cda7dc3cfa46c52dff3fd7c34f69459bd5638
This commit is contained in:
Jakub Wachowski 2016-10-17 14:57:18 +02:00
parent aa1b40a94d
commit d6af474bfa
3 changed files with 9 additions and 8 deletions

View File

@ -20,3 +20,8 @@ export const SESSION_PROJECTS_KEY = `fts-keystone-projects-${NOW_TIME}`;
export const SESSION_TOKEN_CHANGED = `fts-keystone-token-changed-${NOW_TIME}`;
export const TOKEN_CHANGED_VALUE = Symbol('token-changed');
export const RELOAD_MARKUP = `<html>
<head><script type="text/javascript">window.location.reload();</script></head>
<body>reloading...</body>
</html>`;

View File

@ -15,14 +15,10 @@
import Boom from 'boom';
import Joi from 'joi';
import { SESSION_USER_KEY } from '../../const';
import { SESSION_USER_KEY, RELOAD_MARKUP } from '../../const';
import lookupToken from './token';
import RELOAD from './reload';
const RELOAD_MARKUP = `<html>
<head><script type="text/javascript">window.location.reload();</script></head>
<body>reloading...</body>
</html>`;
const NOOP = ()=> {
};
const SCHEMA = {

View File

@ -18,9 +18,9 @@ import {
SESSION_PROJECTS_KEY,
SESSION_USER_KEY,
SESSION_TOKEN_CHANGED,
TOKEN_CHANGED_VALUE
TOKEN_CHANGED_VALUE,
RELOAD_MARKUP
} from '../../const';
import reload from './reload';
export default () => {
return (request, reply) => {
@ -34,7 +34,7 @@ export default () => {
'Detected that token has been changed, replaying the request'
);
session.clear(SESSION_TOKEN_CHANGED);
return reply(reload.markup).type('text/html');
return reply(RELOAD_MARKUP).type('text/html');
} else if (userObj) {
let expiresAt = new Date(userObj.expires_at).valueOf();
let now = new Date().valueOf();