← All examples
ResetPassword
examples/ResetPassword.intent
ResetPassword.intent
1# ResetPassword.intent2# Draft IntentLang (v0). Illustrative only; there is no compiler yet.34mission ResetPassword56goal7 Let a user securely reset their password89why10 A weak reset flow is a common path to account takeover.1112requires13 verified email14 reset token1516input17 email: Email18 token: ResetToken19 newPassword: Secret2021output22 result: PasswordResetResult2324constraints25 token.ttl <= 15 minutes26 password.minLength >= 122728guarantees29 token expires after 15 minutes30 token can only be used once31 password is never logged3233guarantee token can only be used once34 because a reusable reset token is an account-takeover risk35 verify test one time use3637never38 log(newPassword)39 return token4041target42 DotNet4344style45 ASP.NET Core46 EntityFramework47 BCrypt4849verify50 test token expiration51 test one time use52 test password hash stored53 test raw password not loggedDraft syntax. This file is illustrative and does not run yet.
More examples