Browse Source

Merge branch 'feature/dynamic-oauth2-new-table' of https://github.com/vzikratyi-tb/thingsboard into feature/dynamic-oauth2-new-table

pull/3557/head
Vladyslav_Prykhodko 6 years ago
parent
commit
cea5666407
  1. 2
      dao/src/main/java/org/thingsboard/server/dao/oauth2/OAuth2ServiceImpl.java
  2. 2
      dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ServiceTest.java

2
dao/src/main/java/org/thingsboard/server/dao/oauth2/OAuth2ServiceImpl.java

@ -129,7 +129,7 @@ public class OAuth2ServiceImpl extends AbstractEntityService implements OAuth2Se
if (tenant == null) return false;
JsonNode allowOAuth2ConfigurationJsonNode = tenant.getAdditionalInfo() != null ? tenant.getAdditionalInfo().get(ALLOW_OAUTH2_CONFIGURATION) : null;
if (allowOAuth2ConfigurationJsonNode == null) {
return true;
return false;
} else {
return allowOAuth2ConfigurationJsonNode.asBoolean();
}

2
dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ServiceTest.java

@ -66,7 +66,7 @@ public class BaseOAuth2ServiceTest extends AbstractServiceTest {
@Test
public void testIsOAuth2Allowed_null() throws IOException {
updateTenantAllowOAuth2Setting(null);
Assert.assertTrue(oAuth2Service.isOAuth2ClientRegistrationAllowed(tenantId));
Assert.assertFalse(oAuth2Service.isOAuth2ClientRegistrationAllowed(tenantId));
}
@Test

Loading…
Cancel
Save