LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
added user login for local authentication (#107)
ali6f53013aecc5
diff --git a/backend/README.md b/backend/README.mdindex 1b2675342..d668c5f90 100644--- a/backend/README.md+++ b/backend/README.md@@ -35,6 +35,14 @@ python manage.py runserver localhost:8000```- Server will start and run at port 8000. (<http://localhost:8000>)++## Default Username and Password++The default username is `unstract` and the default password is `unstract`.++To customize your password, simply navigate to the `.env` file and update the `DEFAULT_AUTH_PASSWORD` config before launching the server. Then use your new password to log in.++To update the password after it's been set, first change it in the .env file, restart the server for it to take effect, then log in using the new password.## Asynchronous execution/pipeline executiondiff --git a/backend/account/authentication_helper.py b/backend/account/authentication_helper.pyindex 6642ac238..2aa6f341b 100644--- a/backend/account/authentication_helper.py+++ b/backend/account/authentication_helper.py@@ -1,13 +1,11 @@import loggingfrom typing import Any-from account.constants import DefaultOrg-from account.dto import CallbackData, MemberData, OrganizationData+from account.dto import MemberDatafrom account.models import Organization, Userfrom platform_settings.platform_auth_service import (PlatformAuthenticationService,)-from rest_framework.request import Requestlogger = logging.getLogger(__name__)@@ -16,21 +14,6 @@ class AuthenticationHelper:def __init__(self) -> None:pass- def get_organizations_by_user_id(self) -> list[OrganizationData]:- organizationData: OrganizationData = OrganizationData(- id=DefaultOrg.MOCK_ORG,- display_name=DefaultOrg.MOCK_ORG,- name=DefaultOrg.MOCK_ORG,- )- return [organizationData]-- def get_authorize_token(rself, equest: Request) -> CallbackData:- return CallbackData(- user_id=DefaultOrg.MOCK_USER_ID,- email=DefaultOrg.MOCK_USER_EMAIL,- token="",- )-def list_of_members_from_user_model(self, model_data: list[Any]) -> list[MemberData]:diff --git a/backend/account/authentication_service.py b/backend/account/authentication_service.pyindex b60521ef9..2484571e9 100644--- a/backend/account/authentication_service.py+++ b/backend/account/authentication_service.py@@ -3,7 +3,7 @@ import uuidfrom typing import Any, Optionalfrom account.authentication_helper import AuthenticationHelper-from account.constants import Common, DefaultOrg+from account.constants import DefaultOrg, ErrorMessage, UserLoginTemplatefrom account.custom_exceptions import Forbidden, MethodNotImplementedfrom account.dto import (CallbackData,@@ -13,16 +13,19 @@ from account.dto import (ResetUserPasswordDto,UserInfo,UserRoleData,- UserSessionInfo,)from account.enums import UserRolefrom account.models import Organization, Userfrom account.organization import OrganizationService+from account.serializer import LoginRequestSerializer+from django.conf import settings+from django.contrib.auth import authenticate, login, logout+from django.contrib.auth.hashers import make_passwordfrom django.http import HttpRequest+from django.shortcuts import redirect, renderfrom rest_framework.request import Requestfrom rest_framework.response import Responsefrom tenant_account.models import OrganizationMember as OrganizationMember-from utils.cache_service import CacheServiceLogger = logging.getLogger(__name__)@@ -30,21 +33,97 @@ Logger = logging.getLogger(__name__)class AuthenticationService:def __init__(self) -> None:self.authentication_helper = AuthenticationHelper()- self.default_user: User = self.get_user()self.default_organization: Organization = self.user_organization()- self.user_session_info = self.get_user_session_info()- def get_current_organization(self) -> Organization:- return self.default_organization+ def user_login(self, request: Request) -> Any:+ """Authenticate and log in a user.- def get_current_user(self) -> User:- return self.default_user+ Args:+ request (Request): The HTTP request object.- def get_current_user_session(self) -> UserSessionInfo:- return self.user_session_info+ Returns:+ Any: The response object.- def user_login(self, request: HttpRequest) -> Any:- raise MethodNotImplemented()+ Raises:+ ValueError: If there is an error in the login credentials.+ """+ if request.method == "GET":+ return self.render_login_page(request)+ try:+ validated_data = self.validate_login_credentials(request)+ username = validated_data.get("username")+ password = validated_data.get("password")+ except ValueError as e:+ return render(+ request,+ UserLoginTemplate.TEMPLATE,+ {UserLoginTemplate.ERROR_PLACE_HOLDER: str(e)},+ )+ if self.authenticate_and_login(request, username, password):+ return redirect(settings.WEB_APP_ORIGIN_URL)++ return self.render_login_page_with_error(+ request, ErrorMessage.USER_LOGIN_ERROR+ )++ def authenticate_and_login(+ self, request: Request, username: str, password: str+ ) -> bool:+ """Authenticate and log in a user.++ Args:+ request (Request): The HTTP request object.+ username (str): The username of the user.+ password (str): The password of the user.++ Returns:+ bool: True if the user is successfully authenticated and logged in,+ False otherwise.+ """+ user = authenticate(request, username=username, password=password)+ if user:+ login(request, user)+ return True+ # Attempt to initiate default user and authenticate again+ if self.set_default_user(username, password):+ user = authenticate(request, username=username, password=password)+ if user:+ login(request, user)+ return True+ return False++ def render_login_page(self, request: Request) -> Any:+ return render(request, UserLoginTemplate.TEMPLATE)++ def render_login_page_with_error(+ self, request: Request, error_message: str+ ) -> Any:+ return render(+ request,+ UserLoginTemplate.TEMPLATE,+ {UserLoginTemplate.ERROR_PLACE_HOLDER: error_message},+ )++ def validate_login_credentials(self, request: Request) -> Any:+ """Validate the login credentials.++ Args:+ request (Request): The HTTP request object.++ Returns:+ dict: The validated login credentials.++ Raises:+ ValueError: If the login credentials are invalid.+ """+ serializer = LoginRequestSerializer(data=request.POST)+ if not serializer.is_valid():+ error_messages = {+ field: errors[0] for field, errors in serializer.errors.items()+ }+ first_error_message = list(error_messages.values())[0]+ raise ValueError(first_error_message)+ return serializer.validated_datadef user_signup(self, request: HttpRequest) -> Any:raise MethodNotImplemented()@@ -65,8 +144,8 @@ class AuthenticationService:def get_callback_data(self, request: Request) -> CallbackData:return CallbackData(- user_id=DefaultOrg.MOCK_USER_ID,- email=DefaultOrg.MOCK_USER_EMAIL,+ user_id=request.user.user_id,+ email=request.user.email,token="",)@@ -82,7 +161,7 @@ class AuthenticationService:self, request: Request, user: User) -> MemberData:member_data: MemberData = MemberData(- user_id=self.default_user.user_id,+ user_id=user.user_id,organization_id=self.default_organization.organization_id,role=[UserRole.ADMIN.value],)@@ -101,7 +180,7 @@ class AuthenticationService:data: Optional[dict[str, Any]] = None,) -> MemberData:member_data: MemberData = MemberData(- user_id=self.default_user.user_id,+ user_id=user.user_id,organization_id=self.default_organization.organization_id,)@@ -204,38 +283,38 @@ class AuthenticationService:)return organizationData- def get_user(self) -> User:- user = CacheService.get_user_session_info(DefaultOrg.MOCK_USER_EMAIL)- if not user:- try:- user = User.objects.get(email=DefaultOrg.MOCK_USER_EMAIL)- except User.DoesNotExist:- user = User(- username=DefaultOrg.MOCK_USER,- user_id=DefaultOrg.MOCK_USER_ID,- email=DefaultOrg.MOCK_USER_EMAIL,- )- user.save()- if isinstance(user, User):- id = user.id- user_id = user.user_id- email = user.email- else:- id = user[Common.ID]- user_id = user[Common.USER_ID]- email = user[Common.USER_EMAIL]+ def set_default_user(self, username: str, password: str) -> bool:+ """Set the default user for authentication.++ This method creates a default user with the provided username and+ password if the username and password match the default values defined+ in the 'DefaultOrg' class. The default user is saved in the database.++ Args:+ username (str): The username of the default user.+ password (str): The password of the default user.- current_org = Common.PUBLIC_SCHEMA_NAME+ Returns:+ bool: True if the default user is successfully created and saved,+ False otherwise.+ """+ if (+ username != DefaultOrg.MOCK_USER+ or password != DefaultOrg.MOCK_USER_PASSWORD+ ):+ return False- user_session_info: UserSessionInfo = UserSessionInfo(- id=id,- user_id=user_id,- email=email,- current_org=current_org,+ user, created = User.objects.get_or_create(+ username=DefaultOrg.MOCK_USER)- CacheService.set_user_session_info(user_session_info)- user_info = User(id=id, user_id=user_id, username=email, email=email)- return user_info+ if created:+ user.password = make_password(DefaultOrg.MOCK_USER_PASSWORD)+ else:+ user.user_id = DefaultOrg.MOCK_USER_ID+ user.email = DefaultOrg.MOCK_USER_EMAIL+ user.password = make_password(DefaultOrg.MOCK_USER_PASSWORD)+ user.save()+ return Truedef get_user_info(self, request: Request) -> Optional[UserInfo]:user: User = request.user@@ -248,32 +327,7 @@ class AuthenticationService:email=user.email,)else:- user = self.get_user()- return UserInfo(- id=user.id,- user_id=user.user_id,- name=user.username,- display_name=user.username,- email=user.email,- )-- def get_user_session_info(self) -> UserSessionInfo:- user_session_info_dict = CacheService.get_user_session_info(- self.default_user.email- )- if not user_session_info_dict:- user_session_info: UserSessionInfo = UserSessionInfo(- id=self.default_user.id,- user_id=self.default_user.user_id,- email=self.default_user.email,- current_org=self.default_organization.organization_id,- )- CacheService.set_user_session_info(user_session_info)- else:- user_session_info = UserSessionInfo.from_dict(- user_session_info_dict- )- return user_session_info+ return Nonedef get_organization_info(self, org_id: str) -> Optional[Organization]:return OrganizationService.get_organization_by_org_id(org_id=org_id)@@ -300,12 +354,16 @@ class AuthenticationService:return f"{name} organization"def user_logout(self, request: HttpRequest) -> Response:- raise MethodNotImplemented()+ """Log out the user.- def get_user_id_from_token(- self, token: Optional[dict[str, Any]]- ) -> Response:- return DefaultOrg.MOCK_USER_ID+ Args:+ request (HttpRequest): The HTTP request object.++ Returns:+ Response: The redirect response to the web app origin URL.+ """+ logout(request)+ return redirect(settings.WEB_APP_ORIGIN_URL)def get_organization_members_by_org_id(self, organization_id: strdiff --git a/backend/account/constants.py b/backend/account/constants.pyindex 69197e19d..34c9a7726 100644--- a/backend/account/constants.py+++ b/backend/account/constants.py@@ -1,3 +1,6 @@+from django.conf import settings++class LoginConstant:INVITATION = "invitation"ORGANIZATION = "organization"@@ -35,14 +38,21 @@ class Cookie:class ErrorMessage:ORGANIZATION_EXIST = "Organization already exists"DUPLICATE_API = "It appears that a duplicate call may have been made."+ USER_LOGIN_ERROR = "Invalid username or password. Please try again."class DefaultOrg:ORGANIZATION_NAME = "mock_org"MOCK_ORG = "mock_org"- MOCK_USER = "mock_user"+ MOCK_USER = "unstract"MOCK_USER_ID = "mock_user_id"MOCK_USER_EMAIL = "[email protected]"+ MOCK_USER_PASSWORD = settings.DEFAULT_AUTH_PASSWORD+++class UserLoginTemplate:+ TEMPLATE = "login.html"+ ERROR_PLACE_HOLDER = "error_message"class PluginConfig:diff --git a/backend/account/custom_auth_middleware.py b/backend/account/custom_auth_middleware.pyindex 24736b198..3fe18f466 100644--- a/backend/account/custom_auth_middleware.py+++ b/backend/account/custom_auth_middleware.py@@ -1,10 +1,6 @@-from typing import Optional-from account.authentication_plugin_registry import AuthenticationPluginRegistry-from account.authentication_service import AuthenticationServicefrom account.constants import Common, Cookie, DefaultOrgfrom account.dto import UserSessionInfo-from account.models import Userfrom account.user import UserServicefrom django.conf import settingsfrom django.core.cache import cache@@ -22,9 +18,6 @@ class CustomAuthMiddleware:# One-time configuration and initialization.def __call__(self, request: HttpRequest) -> HttpResponse:- user = None- request.user = user-# Returns result without authenticated if added in whitelisted pathsif any(request.path.startswith(path) for path in settings.WHITELISTED_PATHS@@ -47,55 +40,35 @@ class CustomAuthMiddleware:return self.get_response(request)if not AuthenticationPluginRegistry.is_plugin_available():- self.without_authentication(request, user)+ self.local_authentication(request)elif request.COOKIES:self.authenticate_with_cookies(request, tenantAccessiblePublicPath)- if (- request.user # type: ignore- and request.session- and "user" in request.session- ):- response = self.get_response(request) # type: ignore+ if request.user and request.session and "user" in request.session:+ response = self.get_response(request)return responsereturn JsonResponse({"message": "Unauthorized"}, status=401)- def without_authentication(- self, request: HttpRequest, user: Optional[User]- ) -> None:+ def local_authentication(self, request: HttpRequest) -> None:org_id = DefaultOrg.MOCK_ORG- user_id = DefaultOrg.MOCK_USER_ID- email = DefaultOrg.MOCK_USER_EMAIL- user_session_info = CacheService.get_user_session_info(email)-- if user is None:- try:- user_service = UserService()- user = user_service.get_user_by_user_id(user_id)- if not user:- member = user_service.get_user_by_user_id(user_id)- if member:- user = member.user- except AttributeError:- pass- if user is None:- authentication_service = AuthenticationService()- user = authentication_service.get_current_user()-- if user:- if not user_session_info:- user_info: UserSessionInfo = UserSessionInfo(- id=user.id,- user_id=user.user_id,- email=user.email,- current_org=org_id,- )- CacheService.set_user_session_info(user_info)- user_session_info = CacheService.get_user_session_info(email)-- request.user = user- request.org_id = org_id- request.session["user"] = user_session_info- request.session.save()+ if not request.user.is_authenticated:+ return+ user_session_info = CacheService.get_user_session_info(+ request.user.email+ )+ if not user_session_info:+ user_info: UserSessionInfo = UserSessionInfo(+ id=request.user.id,+ user_id=request.user.user_id,+ email=request.user.email,+ current_org=org_id,+ )+ CacheService.set_user_session_info(user_info)+ user_session_info = CacheService.get_user_session_info(+ request.user.email+ )+ request.org_id = org_id+ request.session["user"] = user_session_info+ request.session.save()def authenticate_with_cookies(self,diff --git a/backend/account/serializer.py b/backend/account/serializer.pyindex 6a1985e09..77cb89b2a 100644--- a/backend/account/serializer.py+++ b/backend/account/serializer.py@@ -1,4 +1,5 @@import re+from typing import Optional# from account.enums import Regionfrom account.models import Organization, User@@ -13,8 +14,8 @@ class OrganizationSignupSerializer(serializers.Serializer):def validate_organization_id(self, value): # type: ignoreif not re.match(r"^[a-z0-9_-]+$", value):raise serializers.ValidationError(- "organization_code should only contain alphanumeric "- "characters,_ and -."+ "organization_code should only contain "+ "alphanumeric characters,_ and -.")return value@@ -85,3 +86,26 @@ class OrganizationSignupResponseSerializer(serializers.Serializer):display_name = serializers.CharField()organization_id = serializers.CharField()created_at = serializers.CharField()+++class LoginRequestSerializer(serializers.Serializer):+ username = serializers.CharField(required=True)+ password = serializers.CharField(required=True)++ def validate_username(self, value: Optional[str]) -> str:+ """Check that the username is not empty and has at least 3+ characters."""+ if not value or len(value) < 3:+ raise serializers.ValidationError(+ "Username must be at least 3 characters long."+ )+ return value++ def validate_password(self, value: Optional[str]) -> str:+ """Check that the password is not empty and has at least 3+ characters."""+ if not value or len(value) < 3:+ raise serializers.ValidationError(+ "Password must be at least 3 characters long."+ )+ return valuediff --git a/backend/account/templates/login.html b/backend/account/templates/login.htmlnew file mode 100644index 000000000..4edf8e3f1--- /dev/null+++ b/backend/account/templates/login.html@@ -0,0 +1,134 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Login</title>+ <style>+ /* Centering the form */+ body {+ display: flex;+ justify-content: center;+ align-items: center;+ height: 100vh;+ margin: 0;+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;+ }+ form {+ width: 300px; /* Adjust as needed */+ padding: 20px;+ border: 1px solid #ccc;+ border-radius: 8px;+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);+ position: relative; /* Add this to position spinner relative to the form */+ }+ /* Custom styles */+ h2 {+ text-align: center;+ margin-top: 0; /* Add this to remove default margin */+ }+ label {+ display: block;+ margin-bottom: 5px;+ }+ input[type="text"],+ input[type="password"] {+ width: 100%;+ padding: 8px;+ margin-bottom: 10px;+ border: 1px solid #ccc;+ border-radius: 4px;+ box-sizing: border-box;+ }+ input[type="submit"] {+ width: 100%;+ padding: 10px;+ background: #2F93F6;+ color: white;+ border: none;+ border-radius: 4px;+ cursor: pointer;+ }+ input[type="submit"]:hover {+ background: #2F93F6;+ }+ .error-message {+ color: red;+ text-align: center;+ margin: 10px 0; /* Add margin for spacing */+ font-weight: initial;+ font-size: 12px;+ }+ /* Spinner styles */+ .spinner {+ position: absolute;+ top: 50%;+ left: 50%;+ transform: translate(-50%, -50%);+ display: none; /* Initially hidden */+ }+ .lds-dual-ring {+ display: inline-block;+ width: 64px;+ height: 64px;+ }+ .lds-dual-ring:after {+ content: " ";+ display: block;+ width: 46px;+ height: 46px;+ margin: 1px;+ border-radius: 50%;+ border: 5px solid #00a6de;+ border-color: #00a6de transparent #00a6de transparent;+ animation: lds-dual-ring 1.2s linear infinite;+ }+ @keyframes lds-dual-ring {+ 0% {+ transform: rotate(0deg);+ }+ 100% {+ transform: rotate(360deg);+ }+ }+ .logo-box{+ width: 100%;+ text-align: center;+ margin-bottom: 20px;+ margin-top: 20px;+ }+ .login-heading{+ font-size: 24px;+ font-weight: initial;+ }+ </style>+</head>+<body>+ <form method="post" action="{% url 'login' %}">+ <div class="spinner">+ <!-- Spinner animation -->+ <div class="lds-dual-ring"></div>+ </div>+ {% load static %}+ <div class="logo-box">+ <img src="{% static 'logo.svg' %}" alt="My image">+ </div>+ <h2 class="login-heading">Login</h2>+ {% if error_message %}+ <p class="error-message">{{ error_message }}</p>+ {% endif %}+ {% csrf_token %}+ <label for="username">Username</label>+ <input type="text" id="username" name="username" required>+ <label for="password">Password</label>+ <input type="password" id="password" name="password" required><br><br>+ <input type="submit" value="Login">+ </form>+ <script>+ // Function to show spinner on form submit+ document.querySelector('form').addEventListener('submit', function() {+ document.querySelector('.spinner').style.display = 'block';+ });+ </script>+</body>+</html>diff --git a/backend/account/views.py b/backend/account/views.pyindex 50b2b82d6..3fdea3772 100644--- a/backend/account/views.py+++ b/backend/account/views.py@@ -52,7 +52,7 @@ def callback(request: Request) -> Response:return auth_controller.authorization_callback(request)-@api_view(["GET"])+@api_view(["GET", "POST"])def login(request: Request) -> Response:auth_controller = AuthenticationController()return auth_controller.user_login(request)diff --git a/backend/backend/public_urls.py b/backend/backend/public_urls.pyindex dabd361b7..13a177ca2 100644--- a/backend/backend/public_urls.py+++ b/backend/backend/public_urls.py@@ -18,6 +18,8 @@ from account.admin import adminfrom django.conf import settingsfrom django.conf.urls import * # noqa: F401, F403from django.urls import include, path+from django.conf.urls.static import static+from django.conf import settingspath_prefix = settings.PATH_PREFIXapi_path_prefix = settings.API_DEPLOYMENT_PATH_PREFIX@@ -38,3 +40,4 @@ urlpatterns = [# Feature flagspath(f"{path_prefix}/flags/", include("feature_flag.urls")),]+urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)\ No newline at end of filediff --git a/backend/backend/settings/base.py b/backend/backend/settings/base.pyindex f7fcd159e..c26883d41 100644--- a/backend/backend/settings/base.py+++ b/backend/backend/settings/base.py@@ -140,6 +140,8 @@ WORKFLOW_DATA_DIR = os.environ.get("WORKFLOW_DATA_DIR")API_STORAGE_DIR = os.environ.get("API_STORAGE_DIR")CACHE_TTL_SEC = os.environ.get("CACHE_TTL_SEC", 10800)+DEFAULT_AUTH_PASSWORD = os.environ.get("DEFAULT_AUTH_PASSWORD", "unstract")+# Quick-start development settings - unsuitable for production# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/@@ -191,7 +193,6 @@ TENANT_APPS = ("django.contrib.admin","django.contrib.auth","django.contrib.contenttypes",- "django.contrib.sessions","django.contrib.messages","django.contrib.staticfiles","tenant_account",@@ -374,6 +375,7 @@ USE_TZ = True# Static files (CSS, JavaScript, Images)# https://docs.djangoproject.com/en/4.2/howto/static-files/STATIC_URL = f"/{PATH_PREFIX}/static/"+STATIC_ROOT = os.path.join(BASE_DIR, "static")# Default primary key field type# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field@@ -394,6 +396,7 @@ WHITELISTED_PATHS_LIST = ["/favicon.ico","/logout","/signup",+ "/static",]WHITELISTED_PATHS = [f"/{PATH_PREFIX}{PATH}" for PATH in WHITELISTED_PATHS_LIST]# White lists workflow-api-deployment pathdiff --git a/backend/backend/static/logo.svg b/backend/backend/static/logo.svgnew file mode 100644index 000000000..7a8212795--- /dev/null+++ b/backend/backend/static/logo.svg@@ -0,0 +1,21 @@+<svg width="224" height="40" viewBox="0 0 224 40" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M62.5266 33.8401C58.529 33.8401 55.4082 32.744 53.1644 30.5517C50.9205 28.3594 49.7986 25.2516 49.7986 21.2281V6.21753H57.4586V20.996C57.4586 23.3172 57.91 24.9808 58.8127 25.9866C59.7412 26.9925 61.0049 27.4954 62.604 27.4954C64.2031 27.4954 65.4539 26.9925 66.3566 25.9866C67.2593 24.9808 67.7107 23.3172 67.7107 20.996V6.21753H75.2547V21.2281C75.2547 25.2516 74.1327 28.3594 71.8889 30.5517C69.645 32.744 66.5243 33.8401 62.5266 33.8401Z" fill="#333333"/>+<path d="M93.7522 11.9819C95.3771 11.9819 96.8472 12.3172 98.1625 12.9878C99.4779 13.6326 100.51 14.6384 101.258 16.0054C102.031 17.3723 102.418 19.139 102.418 21.3055V33.2985H95.0676V22.5048C95.0676 21.0089 94.7581 19.9256 94.1391 19.2551C93.5459 18.5587 92.7077 18.2105 91.6244 18.2105C90.8507 18.2105 90.1414 18.3911 89.4966 18.7521C88.8519 19.0874 88.3489 19.6161 87.9879 20.3383C87.6268 21.0605 87.4462 22.0019 87.4462 23.1625V33.2985H80.0957V12.3301H87.098V18.2879L85.744 16.547C86.5435 15.0253 87.6397 13.8905 89.0324 13.1425C90.4251 12.3688 91.9984 11.9819 93.7522 11.9819Z" fill="#333333"/>+<path d="M114.654 33.6467C112.875 33.6467 111.134 33.4403 109.432 33.0277C107.755 32.615 106.401 32.0992 105.37 31.4802L107.575 26.4509C108.555 27.0441 109.702 27.5212 111.018 27.8823C112.333 28.2176 113.623 28.3852 114.887 28.3852C116.125 28.3852 116.976 28.2563 117.44 27.9983C117.93 27.7404 118.175 27.3922 118.175 26.9538C118.175 26.5411 117.943 26.2445 117.479 26.064C117.04 25.8577 116.447 25.7029 115.699 25.5997C114.977 25.4966 114.177 25.3805 113.3 25.2516C112.423 25.1226 111.534 24.955 110.631 24.7486C109.754 24.5165 108.942 24.1812 108.194 23.7428C107.472 23.2785 106.891 22.6595 106.453 21.8858C106.014 21.112 105.795 20.132 105.795 18.9456C105.795 17.6044 106.182 16.418 106.956 15.3864C107.755 14.3289 108.916 13.5036 110.438 12.9104C111.959 12.2914 113.816 11.9819 116.008 11.9819C117.479 11.9819 118.962 12.1367 120.457 12.4461C121.979 12.7299 123.256 13.1683 124.287 13.7615L122.082 18.7521C121.051 18.1589 120.019 17.7592 118.987 17.5528C117.956 17.3207 116.976 17.2047 116.047 17.2047C114.809 17.2047 113.932 17.3465 113.416 17.6302C112.926 17.9139 112.681 18.2621 112.681 18.6748C112.681 19.0874 112.901 19.4098 113.339 19.6419C113.778 19.8483 114.358 20.0159 115.08 20.1449C115.828 20.248 116.64 20.3641 117.517 20.4931C118.394 20.5962 119.271 20.7639 120.148 20.996C121.051 21.2281 121.863 21.5763 122.585 22.0405C123.333 22.479 123.926 23.0851 124.365 23.8588C124.803 24.6068 125.023 25.574 125.023 26.7604C125.023 28.0499 124.623 29.2105 123.823 30.2422C123.05 31.2738 121.889 32.0992 120.341 32.7182C118.82 33.3372 116.924 33.6467 114.654 33.6467Z" fill="#333333"/>+<path d="M137.552 33.6467C134.87 33.6467 132.781 32.989 131.285 31.6736C129.789 30.3325 129.041 28.3207 129.041 25.6384V7.64895H136.392V25.5611C136.392 26.309 136.598 26.9022 137.011 27.3407C137.423 27.7533 137.952 27.9597 138.597 27.9597C139.474 27.9597 140.222 27.7404 140.841 27.302L142.659 32.4474C142.04 32.86 141.279 33.1566 140.376 33.3372C139.474 33.5435 138.532 33.6467 137.552 33.6467ZM125.985 18.5974V13.1038H141.189V18.5974H125.985Z" fill="#333333"/>+<path d="M145.493 33.2985V12.3301H152.496V18.4426L151.451 16.7017C152.07 15.1284 153.076 13.9549 154.469 13.1812C155.862 12.3817 157.551 11.9819 159.537 11.9819V18.5974C159.202 18.5458 158.905 18.52 158.647 18.52C158.415 18.4942 158.157 18.4813 157.873 18.4813C156.377 18.4813 155.165 18.894 154.237 19.7193C153.308 20.5188 152.844 21.8342 152.844 23.6654V33.2985H145.493Z" fill="#333333"/>+<path d="M174.129 33.2985V29.3911L173.626 28.4239V21.2281C173.626 20.0675 173.265 19.1777 172.543 18.5587C171.846 17.9139 170.724 17.5915 169.177 17.5915C168.171 17.5915 167.152 17.7592 166.121 18.0945C165.089 18.404 164.212 18.8424 163.49 19.4098L161.014 14.4192C162.2 13.6454 163.619 13.0522 165.269 12.6396C166.946 12.2011 168.609 11.9819 170.26 11.9819C173.665 11.9819 176.295 12.7685 178.152 14.3418C180.035 15.8893 180.976 18.3266 180.976 21.6537V33.2985H174.129ZM167.939 33.6467C166.262 33.6467 164.844 33.3629 163.683 32.7955C162.523 32.2281 161.633 31.4544 161.014 30.4743C160.421 29.4942 160.124 28.3981 160.124 27.1859C160.124 25.8963 160.447 24.7873 161.091 23.8588C161.762 22.9045 162.781 22.1824 164.148 21.6924C165.515 21.1765 167.281 20.9186 169.448 20.9186H174.4V24.7486H170.454C169.267 24.7486 168.429 24.9421 167.939 25.3289C167.475 25.7158 167.243 26.2316 167.243 26.8764C167.243 27.5212 167.488 28.037 167.978 28.4239C168.468 28.8108 169.138 29.0042 169.989 29.0042C170.789 29.0042 171.511 28.8108 172.156 28.4239C172.826 28.0112 173.316 27.3922 173.626 26.5669L174.632 29.275C174.245 30.7193 173.484 31.8155 172.349 32.5634C171.24 33.2856 169.77 33.6467 167.939 33.6467Z" fill="#333333"/>+<path d="M196.597 33.6467C194.276 33.6467 192.2 33.1824 190.368 32.2539C188.563 31.3254 187.144 30.0488 186.113 28.4239C185.081 26.7733 184.565 24.8905 184.565 22.7756C184.565 20.6607 185.081 18.7908 186.113 17.166C187.144 15.5411 188.563 14.2773 190.368 13.3746C192.2 12.4461 194.276 11.9819 196.597 11.9819C198.97 11.9819 201.02 12.4848 202.748 13.4907C204.476 14.4966 205.701 15.9151 206.423 17.7463L200.736 20.6478C200.246 19.6677 199.64 18.9585 198.918 18.52C198.196 18.0558 197.409 17.8236 196.558 17.8236C195.707 17.8236 194.933 18.0171 194.237 18.404C193.541 18.7908 192.986 19.3582 192.573 20.1062C192.187 20.8283 191.993 21.7181 191.993 22.7756C191.993 23.8588 192.187 24.7744 192.573 25.5224C192.986 26.2703 193.541 26.8377 194.237 27.2246C194.933 27.6115 195.707 27.8049 196.558 27.8049C197.409 27.8049 198.196 27.5857 198.918 27.1472C199.64 26.683 200.246 25.9608 200.736 24.9808L206.423 27.8823C205.701 29.7135 204.476 31.132 202.748 32.1379C201.02 33.1437 198.97 33.6467 196.597 33.6467Z" fill="#333333"/>+<path d="M218.893 33.6467C216.211 33.6467 214.122 32.989 212.626 31.6736C211.13 30.3325 210.382 28.3207 210.382 25.6384V7.64895H217.733V25.5611C217.733 26.309 217.939 26.9022 218.352 27.3407C218.764 27.7533 219.293 27.9597 219.938 27.9597C220.815 27.9597 221.563 27.7404 222.182 27.302L224 32.4474C223.381 32.86 222.62 33.1566 221.718 33.3372C220.815 33.5435 219.873 33.6467 218.893 33.6467ZM207.326 18.5974V13.1038H222.53V18.5974H207.326Z" fill="#333333"/>+<g clip-path="url(#clip0_112_7711)">+<path d="M32.028 2.31582L30.3508 3.99131L30.3494 12.6914C30.3485 19.3066 30.3467 21.418 30.3426 21.502C30.325 21.8675 30.3142 22.0412 30.2966 22.2533C30.194 23.4708 29.9523 24.6639 29.5702 25.8416C29.5553 25.8872 29.544 25.9242 29.5444 25.9242C29.5499 25.9242 29.862 25.588 29.9822 25.4526C31.4457 23.8078 32.5285 21.8481 33.1333 19.7489C33.4563 18.6289 33.6406 17.4971 33.6935 16.3126C33.707 16.0031 33.7075 15.7165 33.7061 8.21589L33.7048 0.640793L32.028 2.31582Z" fill="#7FB800"/>+<path d="M34.984 8.38867C34.9831 14.2716 34.9813 16.1655 34.9772 16.2494C34.9578 16.6501 34.9492 16.7914 34.9289 17.0346C34.703 19.7222 33.7951 22.3079 32.2886 24.5569C31.6987 25.4373 31.0405 26.2369 30.283 26.9936C29.6791 27.5974 29.0611 28.1258 28.37 28.6294C28.3329 28.6565 28.2851 28.6939 28.2638 28.7124C28.2214 28.7494 28.1744 28.7819 28.1387 28.8004C28.1256 28.8067 28.0836 28.8338 28.0461 28.86C27.3423 29.3482 26.555 29.8013 25.7568 30.1781C23.8587 31.0733 21.8084 31.5823 19.697 31.6821C19.2245 31.7042 18.6468 31.7051 18.1793 31.6843C16.8978 31.6266 15.6483 31.4217 14.4142 31.0661C14.2245 31.0115 13.8044 30.8811 13.7425 30.8576C13.7236 30.8504 14.0361 31.1388 14.2448 31.3211C15.5227 32.4375 17.0048 33.3318 18.5763 33.9356C19.9812 34.4757 21.4502 34.7907 22.9517 34.8747C23.2466 34.8909 23.3315 34.8927 23.8054 34.8927C24.2792 34.8927 24.3642 34.8909 24.6591 34.8747C27.3961 34.7217 30.0183 33.8007 32.2525 32.2064C33.1347 31.5769 33.9527 30.8428 34.6741 30.0323C36.1738 28.3483 37.2552 26.3537 37.842 24.1891C38.1103 23.1982 38.2725 22.168 38.3235 21.1274C38.3263 21.0741 38.3308 20.9794 38.3335 20.9176C38.3375 20.8327 38.3394 18.7033 38.3403 12.398L38.3416 3.99127L36.6635 2.31488L34.9854 0.638496L34.984 8.38867Z" fill="#00A6ED"/>+<path d="M0.00135515 13.3005C0.00225858 19.2899 0.00406544 21.3607 0.00813088 21.4432C0.0239409 21.7808 0.0343304 21.95 0.0519473 22.1598C0.232182 24.2951 0.893042 26.3776 1.98123 28.2395C2.26129 28.7191 2.57252 29.1875 2.90182 29.6266C3.18279 30.0011 3.48047 30.3617 3.78493 30.6961C4.10519 31.0471 4.52619 31.4654 4.84149 31.7448L4.87401 31.7732L4.86091 31.7448C4.85369 31.729 4.8302 31.6771 4.80852 31.6301C4.40694 30.7565 4.07809 29.8247 3.84184 28.8915C3.55049 27.7386 3.39329 26.5906 3.36077 25.3713C3.35806 25.2694 3.35625 22.1278 3.35625 16.915V8.62103L1.67812 6.94465L0 5.26826L0.00135515 13.3005Z" fill="#FF4D6D"/>+<path d="M6.31174 6.94566L4.63452 8.62115V16.8564C4.63452 22.0679 4.63633 25.163 4.63904 25.2857C4.64536 25.5741 4.6562 25.8047 4.67518 26.0641C4.83554 28.2522 5.48149 30.3681 6.56922 32.2688C7.12302 33.2367 7.78479 34.1396 8.54141 34.9605C8.80702 35.2479 9.12006 35.5606 9.40735 35.8246C11.7414 37.9712 14.6929 39.3087 17.8246 39.6399C18.7637 39.7387 19.753 39.7496 20.6953 39.671C22.8978 39.4878 25.0458 38.8046 26.9592 37.6783C28.2105 36.9423 29.3452 36.0277 30.3326 34.9605C30.4392 34.8449 30.6086 34.655 30.6068 34.6527C30.6059 34.6518 30.5752 34.6653 30.5391 34.6829C30.2947 34.7994 29.9496 34.9487 29.646 35.0692C27.5148 35.9144 25.2535 36.2777 22.9064 36.1518C22.1453 36.1107 21.3783 36.0128 20.6271 35.8607C18.8993 35.5105 17.2406 34.8689 15.7174 33.9619C13.9376 32.9019 12.367 31.4868 11.1257 29.8253C11.0719 29.7531 11.01 29.6691 10.9875 29.6384C10.9653 29.6078 10.936 29.5699 10.922 29.5541C10.8863 29.5153 10.8646 29.485 10.8348 29.4331C10.8203 29.4088 10.7869 29.3569 10.7602 29.3181C10.4928 28.9313 10.2114 28.4783 9.9729 28.0496C8.88833 26.1025 8.23424 23.964 8.04769 21.7547C8.02691 21.5128 8.01652 21.3387 7.9989 20.965C7.99484 20.8775 7.99303 18.9845 7.99122 13.0601L7.98851 5.27063L6.31174 6.94566Z" fill="#FFB400"/>+</g>+<defs>+<clipPath id="clip0_112_7711">+<rect width="38.3416" height="39.7233" fill="white"/>+</clipPath>+</defs>+</svg>diff --git a/backend/sample.env b/backend/sample.envindex a18ca973d..9da40eeb5 100644--- a/backend/sample.env+++ b/backend/sample.env@@ -107,3 +107,6 @@ ENCRYPTION_KEY="Sample-Key"# Cache TTLCACHE_TTL_SEC=10800++# Default user+DEFAULT_AUTH_PASSWORD=diff --git a/frontend/src/components/log-in/Login.css b/frontend/src/components/log-in/Login.cssindex 78fae446b..08bf177f2 100644--- a/frontend/src/components/log-in/Login.css+++ b/frontend/src/components/log-in/Login.css@@ -77,4 +77,7 @@.signin-text-wrapper{display: flex;justify-content: center;+}+.button-margin {+ margin-top: 60px;}\ No newline at end of filediff --git a/frontend/src/components/log-in/Login.jsx b/frontend/src/components/log-in/Login.jsxindex bcd1a7be7..0dbf19aca 100644--- a/frontend/src/components/log-in/Login.jsx+++ b/frontend/src/components/log-in/Login.jsx@@ -1,10 +1,16 @@-import { Button, Typography } from "antd";+import { Typography, Button } from "antd";import logo from "../../assets/UnstractLogoBlack.svg";import loginBG from "../../assets/login-page-bg.svg";import { getBaseUrl } from "../../helpers/GetStaticData";import "./Login.css";+let LoginForm = null;+try {+ LoginForm = require("../../plugins/login-form/LoginForm").LoginForm;+} catch {+ // The components will remain null of it is not available+}function Login() {const baseUrl = getBaseUrl();const newURL = baseUrl + "/api/v1/login";@@ -17,20 +23,15 @@ function Login() {<div className="login-left-section"><div className="button-wraper"><img src={logo} alt="Logo" className="logo" />- <div className="text-wrapper">- <Typography.Title level={3}>Sign Up</Typography.Title>- <Typography>- Try Unstract free for 14 days. No credit card required.- </Typography>- </div>- <Button className="login-button" onClick={handleLogin}>- Create Your free account- </Button>- <div className="signin-text-wrapper">- <Typography>- Already have an account? <a href={newURL}>Sign in</a>- </Typography>- </div>+ {LoginForm && <LoginForm handleLogin={handleLogin} newURL={newURL} />}+ {!LoginForm && (+ <Button+ className="login-button button-margin"+ onClick={handleLogin}+ >+ Login+ </Button>+ )}</div></div><div className="login-right-section">