Skip to content

Commit

Permalink
backend: add logged_out_redirect_url config
Browse files Browse the repository at this point in the history
set LOGGED_OUT_REDIRECT_URL to the url of the landing page of the instance
  • Loading branch information
anuejn committed Oct 8, 2023
1 parent c1919f5 commit 8493de1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions backend/openapi-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ components:
type: object
PublicConfig:
properties:
logged_out_redirect_url:
title: Logged Out Redirect Url
type: string
models:
additionalProperties:
$ref: '#/components/schemas/ModelConfig'
Expand Down
8 changes: 7 additions & 1 deletion backend/transcribee_backend/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from os import environ
from pathlib import Path
from typing import Dict, List, Optional

Expand All @@ -15,6 +16,7 @@ class Settings(BaseSettings):
task_attempt_limit = 5

media_url_base = "http://localhost:8000/"
logged_out_redirect_url: None | str = None

model_config_path: Path = Path("data/models.json")
pages_dir: Path = Path("data/pages/")
Expand All @@ -28,6 +30,7 @@ class ModelConfig(BaseModel):

class PublicConfig(BaseModel):
models: Dict[str, ModelConfig]
logged_out_redirect_url: str | None


class ShortPageConfig(BaseModel):
Expand Down Expand Up @@ -69,7 +72,10 @@ def get_short_page_config() -> Dict[str, ShortPageConfig]:


def get_public_config():
return PublicConfig(models=get_model_config())
return PublicConfig(
models=get_model_config(),
logged_out_redirect_url=settings.logged_out_redirect_url,
)


settings = Settings()
2 changes: 2 additions & 0 deletions frontend/src/openapi-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ export interface components {
};
/** PublicConfig */
PublicConfig: {
/** Logged Out Redirect Url */
logged_out_redirect_url?: string;
/** Models */
models: {
[key: string]: components["schemas"]["ModelConfig"] | undefined;
Expand Down

0 comments on commit 8493de1

Please sign in to comment.