🐛 fix(auth.py): set AUTO_LOGIN to False to disable automatic login as a super user

🐛 fix(API/index.ts): add null check for response object before checking status to prevent potential error
This commit is contained in:
Cristhian Zanforlin Lousa 2023-08-28 18:22:59 -03:00
commit 6c03edc50a
2 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ class AuthSettings(BaseSettings):
# If AUTO_LOGIN = True
# > The application does not request login and logs in automatically as a super user.
AUTO_LOGIN: bool = True
AUTO_LOGIN: bool = False
FIRST_SUPERUSER: str = "langflow"
FIRST_SUPERUSER_PASSWORD: str = "langflow"

View file

@ -163,7 +163,7 @@ export async function updateFlowInDatabase(
export async function readFlowsFromDatabase() {
try {
const response = await api.get(`${BASE_URL_API}flows/`);
if (response.status !== 200) {
if (response?.status !== 200) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.data;
@ -176,7 +176,7 @@ export async function readFlowsFromDatabase() {
export async function downloadFlowsFromDatabase() {
try {
const response = await api.get(`${BASE_URL_API}flows/download/`);
if (response.status !== 200) {
if (response?.status !== 200) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.data;