mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
20 lines
468 B
JavaScript
20 lines
468 B
JavaScript
'use strict';
|
|
|
|
const configUtils = require('./config');
|
|
|
|
function isLoggedIn() {
|
|
const config = configUtils.getConfig();
|
|
const currentId = config.userId;
|
|
const globalConfig = configUtils.getGlobalConfig();
|
|
if (globalConfig
|
|
&& globalConfig.users
|
|
&& globalConfig.users[currentId]
|
|
&& globalConfig.users[currentId].dashboard
|
|
&& globalConfig.users[currentId].dashboard.idToken) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
module.exports = isLoggedIn;
|