Tahinli/forge
public0 watching
★ 0
| 1 | //! Account mail: the password reset, email verification and invite links. Each function mints |
| 2 | //! its token in the store and queues one message keyed by the token's hash, so a retried call |
| 3 | //! queues nothing twice. The token itself appears only in the link. |
| 4 | |
| 5 | use User; |
| 6 | use hash_token; |
| 7 | |
| 8 | use ; |
| 9 | use crateAppState; |
| 10 | |
| 11 | /// The base URL without a trailing slash, for building links. |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | /// Queues a reset link to the user's verified address. The caller decides that the address is |
| 17 | /// verified. A user without an address gets nothing. |
| 18 | pub async |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | /// Queues a verification link for `address`, which is the user's current address. |
| 37 | pub async |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | /// Creates an invite for `address` and queues its link. Returns the store's refusal, such as an |
| 53 | /// address that already has an account. |
| 54 | pub async |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 |