feat: login wall (#42)

* feat: add login-wall app

* fix: rename vars

* fix: rename vars

* update docker file

* add validations for app state

* add host check for app

* fix: docker file
This commit is contained in:
Lakhan Samani
2021-08-04 12:18:57 +05:30
committed by GitHub
parent d1973c1f8f
commit f88363e6dc
41 changed files with 2274 additions and 120 deletions

View File

@@ -26,14 +26,14 @@ func SendVerificationMail(toEmail, token string) error {
<a href="%s">Click here to verify</a>
</body>
</html>
`, constants.AUTHORIZER_DOMAIN+"/verify_email"+"?token="+token)
`, constants.AUTHORIZER_URL+"/verify_email"+"?token="+token)
bodyMessage := sender.WriteHTMLEmail(Receiver, Subject, message)
return sender.SendMail(Receiver, Subject, bodyMessage)
}
// SendForgotPasswordMail to send verification email
func SendForgotPasswordMail(toEmail, token string) error {
func SendForgotPasswordMail(toEmail, token, host string) error {
sender := email.NewSender()
// The receiver needs to be in slice as the receive supports multiple receiver
@@ -51,7 +51,7 @@ func SendForgotPasswordMail(toEmail, token string) error {
<a href="%s">Reset Password</a>
</body>
</html>
`, constants.FRONTEND_URL+"/"+constants.FORGOT_PASSWORD_URI+"?token="+token)
`, host+"/"+constants.FORGOT_PASSWORD_URI+"?token="+token)
bodyMessage := sender.WriteHTMLEmail(Receiver, Subject, message)
return sender.SendMail(Receiver, Subject, bodyMessage)