Skip to content
Snippets Groups Projects
Commit 6ee78b3e authored by Bayu Samudra's avatar Bayu Samudra
Browse files

Merge branch 'fix/s1-sb20-implementasi-api-verifikasi-email' into 'staging'

fix(email): changed verification method

See merge request !20
parents bae96b21 b5df1f02
Branches
Tags
2 merge requests!25Staging v1.3.0,!20fix(email): changed verification method
Pipeline #53027 passed with stage
in 2 minutes and 34 seconds
......@@ -6,6 +6,9 @@ RUN go install github.com/google/wire/cmd/wire@latest
RUN go install github.com/swaggo/swag/cmd/swag@latest
COPY . /app
RUN git config --global --add safe.directory /app
WORKDIR /app
EXPOSE 8080
......
......@@ -13,11 +13,9 @@ type SmtpMailProvider struct {
}
func New(env *env.Environment) *SmtpMailProvider {
auth := smtp.PlainAuth(
env.SmtpIdentity,
auth := smtp.CRAMMD5Auth(
env.SmtpUsername,
env.SmtpPassword,
env.SmtpServer,
)
return &SmtpMailProvider{
......
......@@ -56,7 +56,7 @@ func (rs ResetServiceImpl) Request(payload request.RequestRequestPayload) error
// Cache Website on Redis, TTL 30 mins
rs.CacheRepository.Set(*cache.NewString(*cache.NewKey(rs.RedisPrefixKey+"resetPassword", resetToken), payload.Email, 30))
// TODO: Send Reset Email
// Send Reset Email
mailBuilder, err := rs.TemplateWritterBuilder.Get("reset-password.format.html")
if err != nil {
......
......@@ -38,7 +38,7 @@ type Environment struct {
SmtpPort int `env:"SMTP_PORT" envDefault:"25"`
FrontendBaseURL string `env:"FE_BASE_URL"`
ResetPasswordPath string `env:"RESET_PASSWORD_PATH" envDefault:"/reset"`
ResetPasswordPath string `env:"RESET_PASSWORD_PATH" envDefault:"/resetPassword"`
EmailVerificationPath string `env:"EMAIL_VERIFICATION_PATH" envDefault:"/verification"`
EmailVerificationMaxRetry int64 `env:"EMAIL_VERIFICATION_MAX_RETRY" envDefault:"5"`
......
......@@ -248,7 +248,7 @@
<td
style="line-height: 24px; font-size: 16px; border-radius: 6px; margin: 0;"
align="center" bgcolor="#0d6efd">
<a href="{{ .BaseUrl }}/?token={{ .Token }}" target="_blank"
<a href="{{ .BaseUrl }}/{{ .Token }}" target="_blank"
style="color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; border-radius: 6px; line-height: 20px; display: block; font-weight: normal; white-space: nowrap; background-color: #0d6efd; padding: 8px 12px; border: 1px solid #0d6efd;">Reset
Password</a>
</td>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment