mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-01-02 23:21:21 -05:00
feat: First Time Setup Wizard (#3204)
* extract user registration form into a composable * added base wizard component * added partial setup implementation * removed unused attrs * added setup bypass * made setup page more readable * add checkbox hints to autoform * added common settings pages and initial submit logic * bypass setup in demo * add full name to user registration * added fullname and pw handling to setup * fixed wizard indentation * added post-setup suggestions * added tests for backend changes * renamed Wizard to BaseWizard * lint fixes * pass hardcoded default password instead of backend nonsense * removed old test * fix e2e * added setup skip to e2e testing for all admin users --------- Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
@@ -47,6 +47,7 @@ def get_startup_info(session: Session = Depends(generate_session)):
|
||||
|
||||
return AppStartupInfo(
|
||||
is_first_login=is_first_login,
|
||||
is_demo=settings.IS_DEMO,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ class AppStartupInfo(MealieModel):
|
||||
it is removed, this will always return False.
|
||||
"""
|
||||
|
||||
is_demo: bool
|
||||
|
||||
|
||||
class AdminAboutInfo(AppInfo):
|
||||
versionLatest: str
|
||||
|
||||
@@ -10,8 +10,9 @@ from mealie.schema._mealie.validators import validate_locale
|
||||
class CreateUserRegistration(MealieModel):
|
||||
group: str | None = None
|
||||
group_token: Annotated[str | None, Field(validate_default=True)] = None
|
||||
email: Annotated[str, StringConstraints(to_lower=True, strip_whitespace=True)] # type: ignore
|
||||
username: Annotated[str, StringConstraints(to_lower=True, strip_whitespace=True)] # type: ignore
|
||||
email: Annotated[str, StringConstraints(to_lower=True, strip_whitespace=True)]
|
||||
username: Annotated[str, StringConstraints(to_lower=True, strip_whitespace=True)]
|
||||
full_name: Annotated[str, StringConstraints(strip_whitespace=True)]
|
||||
password: str
|
||||
password_confirm: str
|
||||
advanced: bool = False
|
||||
|
||||
@@ -49,7 +49,7 @@ class DeleteTokenResponse(MealieModel):
|
||||
|
||||
|
||||
class ChangePassword(MealieModel):
|
||||
current_password: str
|
||||
current_password: str = ""
|
||||
new_password: str = Field(..., min_length=8)
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class RegistrationService:
|
||||
email=self.registration.email,
|
||||
username=self.registration.username,
|
||||
password=hash_password(self.registration.password),
|
||||
full_name=self.registration.username,
|
||||
full_name=self.registration.full_name,
|
||||
advanced=self.registration.advanced,
|
||||
group=group,
|
||||
can_invite=new_group,
|
||||
|
||||
Reference in New Issue
Block a user