* Added an option to remove authentication

* Updated README to document disabling authentication

Co-authored-by: Przemek Dragańczuk <admin@draganczuk.tk>
This commit is contained in:
Przemek Dragańczuk
2020-09-19 10:01:36 +02:00
committed by GitHub
parent 8734ba63d9
commit a26e3fb98f
3 changed files with 26 additions and 3 deletions

View File

@@ -27,4 +27,14 @@ public class Utils {
return PATTERN.matcher(shortUrl)
.matches();
}
public static boolean isPasswordEnabled(){
String disablePasswordEnv = System.getenv("INSECURE_DISABLE_PASSWORD");
if(disablePasswordEnv != null && disablePasswordEnv.equals("I_KNOW_ITS_BAD")){
return false;
}
return true;
}
}