hoppinworld_backend

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit cb815bc816d0da9f7c0777f32451987e3b9e58af
parent 0971d8a6431ac462e4ad2807a0e0686d8b9657aa
Author: Joël Lupien (Jojolepro) <jojolepromain@gmail.com>
Date:   Sat, 20 Oct 2018 13:39:13 -0400

Set temporary address for mails

Diffstat:
Msrc/endpoint.rs | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/endpoint.rs b/src/endpoint.rs @@ -111,7 +111,7 @@ pub fn register(db: DbConn, register: Json<UserInsert>) -> Result<(), ReturnStat // Unwrap should be safe, as we inserted into the db just a split second ago. let user = user_from_email(&db, &register.email).unwrap(); let password_reset = PasswordResetInsert { - token: token.to_string(), + token: token.to_string().clone(), userid: user.id, valid_until: limit.naive_local(), }; @@ -124,11 +124,13 @@ pub fn register(db: DbConn, register: Json<UserInsert>) -> Result<(), ReturnStat // Send email let email = EmailBuilder::new() // Addresses can be specified by the tuple (email, alias) - .to("jojolepromain@gmail.com") + //.to("jojolepromain@gmail.com") + // TODO: Fix email sending. My ip raidable.ddns.net might be blocked + .to("jojolepro@hoppinworld.net") // ... or by an address only .from("noreply@hoppinworld.net") .subject("Hi, Hello world") - .text("Hello world.") + .text(format!("Here's the password reset token: {}",token.to_string())) //.html() .build() .unwrap();