mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request #864 from rasika/master
Fixing Log-in api call per every page load.
This commit is contained in:
commit
f3a926b91c
@ -50,11 +50,10 @@ function onRequest(context) {
|
||||
var BILLING_INFO_RETRY_COUNT_KEY = 'BILLING_INFO_RETRY_COUNT_' + context.user.domain;
|
||||
|
||||
if (viewModal.Main.Account.billingEnabled) {
|
||||
var cookie = getLoginCookie();
|
||||
if (!session.get(BILLING_INFO_KEY) || daysAfterLastCheck(session.get(BILLING_INFO_KEY).lastChecked) > 1) {
|
||||
session.put(BILLING_INFO_RETRY_COUNT_KEY, 0);
|
||||
var serviceUrl = viewModal.Main.Account.cloudMgtHost + "/cloudmgt/site/blocks/admin/admin.jag";
|
||||
getBillingData(serviceUrl, cookie, 1);
|
||||
getBillingData(serviceUrl, getLoginCookie(), 1);
|
||||
}
|
||||
|
||||
var billingInfo = session.get(BILLING_INFO_KEY);
|
||||
@ -65,7 +64,7 @@ function onRequest(context) {
|
||||
var cloudMgtIndexPage = viewModal.Main.Account.cloudMgtIndexPage;
|
||||
|
||||
if (!billingInfo) {
|
||||
recordFirstLogin(serviceUrl, cookie, 1);
|
||||
recordFirstLogin(serviceUrl, getLoginCookie(), 1);
|
||||
log.info("Access denied for tenant: " + context.user.domain
|
||||
+ " with a NULL subscription. Redirected to CloudMgt");
|
||||
response.sendRedirect(cloudMgtIndexPage);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user