BaseURL configuration variable generalization
This commit is contained in:
@ -18,13 +18,12 @@ import (
|
||||
)
|
||||
|
||||
type SendConfirmationEmailRequest struct {
|
||||
Email string
|
||||
Challenge string
|
||||
DefaultScheme string
|
||||
DefaultAddress string
|
||||
RememberMe bool
|
||||
ClientName string
|
||||
ClientURI string
|
||||
Email string
|
||||
Challenge string
|
||||
BaseURL string
|
||||
RememberMe bool
|
||||
ClientName string
|
||||
ClientURI string
|
||||
}
|
||||
|
||||
func HandleSendConfirmationEmailRequest(ctx context.Context, cmd cqrs.Command) error {
|
||||
@ -56,21 +55,7 @@ func HandleSendConfirmationEmailRequest(ctx context.Context, cmd cqrs.Command) e
|
||||
return errors.Wrap(err, "could not generate jwt")
|
||||
}
|
||||
|
||||
address := req.DefaultAddress
|
||||
if conf.HTTP.PublicAddress != "" {
|
||||
address = conf.HTTP.PublicAddress
|
||||
}
|
||||
|
||||
scheme := req.DefaultScheme
|
||||
if scheme == "" {
|
||||
scheme = "http:"
|
||||
}
|
||||
|
||||
if conf.HTTP.PublicScheme != "" {
|
||||
scheme = conf.HTTP.PublicScheme
|
||||
}
|
||||
|
||||
verificationLink := fmt.Sprintf("%s//%s/verify?token=%s", scheme, address, token)
|
||||
verificationLink := fmt.Sprintf("%s/verify?token=%s", req.BaseURL, token)
|
||||
|
||||
data := template.Data{
|
||||
"ClientName": req.ClientName,
|
||||
|
Reference in New Issue
Block a user