Skip to content

Commit e09638d

Browse files
authored
feat: add forgot password command (#20)
2 parents 5c32b4b + 4807d1b commit e09638d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

labctl/main.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,3 +257,15 @@ def change_password():
257257
console.print(f"[red]Error: {data['detail']}[/red]")
258258
return
259259
console.print(f"[green]{data.get("message")} for {config.username}[/green]")
260+
261+
@app.command()
262+
def forgot_password(email: str):
263+
"""
264+
Request a password reset for the FastOnBoard-API server
265+
"""
266+
config = Config()
267+
if not config.api_endpoint:
268+
console.print("[red]Error: Config not ready use `labctl config set --api-endpoint=<server>`[/red]")
269+
return
270+
APIDriver().post(f"/users/forgot-password?email={email}").json()
271+
console.print(f"[green]If the email is registered you will receive a password reset link[/green]")

0 commit comments

Comments
 (0)