🐛 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:
parent
acd661f629
commit
6c03edc50a
2 changed files with 3 additions and 3 deletions
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue