Skip to content

Commit

Permalink
Merge 9d77ba2 into 95bcf03
Browse files Browse the repository at this point in the history
  • Loading branch information
bajtos committed Jun 29, 2018
2 parents 95bcf03 + 9d77ba2 commit f9fc3f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/application.js
Expand Up @@ -497,8 +497,10 @@ app._verifyAuthModelRelations = function() {
function verifyUserRelations(Model) {
const hasManyTokens = Model.relations && Model.relations.accessTokens;

const relationsConfig = Model.settings.relations || {};
const hasPolyMorphicTokens = (relationsConfig.accessTokens || {}).polymorphic;
// display a temp warning message for users using multiple users config
if (hasManyTokens.polymorphic) {
if (hasPolyMorphicTokens) {
console.warn(
'The app configuration follows the multiple user models setup ' +
'as described in http://ibm.biz/setup-loopback-auth',
Expand All @@ -508,7 +510,6 @@ app._verifyAuthModelRelations = function() {

if (hasManyTokens) return;

const relationsConfig = Model.settings.relations || {};
const accessTokenName = (relationsConfig.accessTokens || {}).model;
if (accessTokenName) {
console.warn(
Expand Down

0 comments on commit f9fc3f0

Please sign in to comment.