]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git/blobdiff - api/password_reset.go
Better go import paths.
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git] / api / password_reset.go
index 82aaaef086d69e66bba3f1241c3d8f997fad8469..0c55c0204a5afb65c2d9312c9ae3505bfdaf3d1d 100644 (file)
@@ -5,7 +5,7 @@ import (
        "time"
 
        "github.com/dchest/passwordreset"
-       "immae.eu/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front/db"
+       "git.immae.eu/Cryptoportfolio/Front.git/db"
 )
 
 var PASSWORD_RESET_SECRET []byte
@@ -42,7 +42,14 @@ func (q PasswordResetQuery) Run() (interface{}, *Error) {
                }
        }
 
-       return "OK", nil
+       if MAIL_CONFIG.IsEnabled {
+               err = SendResetPasswordMail(q.In.Email, token)
+               if err != nil {
+                       return nil, NewInternalError(err)
+               }
+       }
+
+       return nil, nil
 }
 
 type ChangePasswordQuery struct {
@@ -99,5 +106,5 @@ func (q ChangePasswordQuery) Run() (interface{}, *Error) {
                return nil, NewInternalError(err)
        }
 
-       return "OK", nil
+       return nil, nil
 }