mirror of
https://github.com/rommapp/romm.git
synced 2026-02-18 23:42:07 +01:00
refactor: update password reset endpoint documentation and improve scroll behavior in router
This commit is contained in:
@@ -277,11 +277,10 @@ async def auth_openid(request: Request):
|
||||
|
||||
@router.post("/forgot-password")
|
||||
def request_password_reset(username: str = Body(..., embed=True)) -> MessageResponse:
|
||||
"""Request password reset by email.
|
||||
""" "Request a password reset link for the user.
|
||||
|
||||
Args:
|
||||
email (str): User's email
|
||||
|
||||
username (str): Username of the user requesting the reset
|
||||
Returns:
|
||||
MessageResponse: Confirmation message
|
||||
"""
|
||||
|
||||
@@ -190,6 +190,15 @@ interface RoutePermissions {
|
||||
const router = createRouter({
|
||||
history: createWebHistory(process.env.BASE_URL),
|
||||
routes,
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
// If savedPosition is available, it's a popstate navigation (back/forward)
|
||||
if (savedPosition) {
|
||||
return savedPosition;
|
||||
} else {
|
||||
// Otherwise, scroll to top
|
||||
return { left: 0, top: 0 };
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const routePermissions: RoutePermissions[] = [
|
||||
@@ -257,11 +266,6 @@ router.beforeEach(async (to, _from, next) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.afterEach(() => {
|
||||
// Scroll to top to avoid annoying behaviour on mobile
|
||||
// window.scrollTo({ top: 0, left: 0 });
|
||||
});
|
||||
|
||||
router.beforeResolve(async () => {
|
||||
const viewTransition = startViewTransition();
|
||||
await viewTransition.captured;
|
||||
|
||||
Reference in New Issue
Block a user