Use preference client for auto login related configs
@@ -66,6 +66,8 @@ public class PreferenceRetrievalClient {
private static final String PROPERTY_VALUE = "value";
private static final String TYPING_DNA_CONNECTOR = "typingdna-config";
private static final String TYPING_DNA_PROPERTY = "adaptive_authentication.tdna.enable";
+ private static final String AUTO_LOGIN_AFTER_SELF_SIGN_UP = "SelfRegistration.AutoLogin.Enable";
+ private static final String AUTO_LOGIN_AFTER_PASSWORD_RECOVERY = "Recovery.AutoLogin.Enable";
/**
* Check self registration is enabled or not.
@@ -166,6 +168,30 @@ public class PreferenceRetrievalClient {
return checkPreference(tenant, TYPING_DNA_CONNECTOR, TYPING_DNA_PROPERTY, false);
}
+ /**
+ * Check auto login after self sign up is enabled or not.
+ *
+ * @param tenant tenant domain name.
+ * @return returns true if auto login after self sign up is enabled .
+ * @throws PreferenceRetrievalClientException
+ */
+ public boolean checkAutoLoginAfterSelfRegistrationEnabled(String tenant) throws PreferenceRetrievalClientException {
+
+ return checkPreference(tenant, SELF_SIGN_UP_CONNECTOR, AUTO_LOGIN_AFTER_SELF_SIGN_UP);
+ }
+
+ /**
+ * Check auto login after password recovery is enabled or not.
+ *
+ * @param tenant tenant domain name.
+ * @return returns true if auto login after password recover is enabled .
+ * @throws PreferenceRetrievalClientException
+ */
+ public boolean checkAutoLoginAfterPasswordRecoveryEnabled(String tenant) throws PreferenceRetrievalClientException {
+
+ return checkPreference(tenant, RECOVERY_CONNECTOR, AUTO_LOGIN_AFTER_PASSWORD_RECOVERY);
+ }
+
/**
* Check for preference in the given tenant.
*
