// // ForgotPasswordPage.swift // // Copyright 2026 Brendan Szymanski // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // SPDX-License-Identifier: GPL-3.0-or-later // import Logging import LuminateCore import Portico private let logger = Logger(label: "\(AppInfo.identifier).onboarding") /// The password-reset entry page. /// /// The reset flow is not implemented yet: submitting the form shows an explanatory toast instead of /// resetting a password. See ``signIn()``. package struct ForgotPasswordPage: View { @State private var isLoading = false @State private var username: String = "" private let toastManager = ToastManager() package init() {} package var body: some View { ToastOverlay { ToolbarView { Clamp { StatusPage(description: "Enter your username, if you remember it", title: "Reset Your Password") { PreferencesGroup { EntryRow("Username", text: $username) ButtonRow("Continue") { Task { await signIn() } } .suggestedAction() .sensitive({ !isLoading }) } .separateRows(true) } } .vexpand(true) .valign(.center) } top: { HeaderBar() } .navigationTitle("Forgot Password") } .toastManager(toastManager) } private func signIn() async { guard !isLoading else { return } isLoading = true defer { isLoading = false } logger.notice("Forgot password functionality is currently unimplemented and will be added at a later date") toastManager.addToast(.init(title: "Password reset isn't available yet")) } }