mirror of
https://github.com/volatiletech/authboss.git
synced 2025-04-11 11:41:48 +02:00
Rename HostName to RootURL
This commit is contained in:
parent
2b6954709d
commit
dccabb0754
@ -20,8 +20,8 @@ type Config struct {
|
||||
MountPath string
|
||||
// ViewsPath is the path to search for overridden templates.
|
||||
ViewsPath string
|
||||
// HostName is the host of the web application (eg https://www.happiness.com:8080) for e-mail url generation. No trailing slash.
|
||||
HostName string
|
||||
// RootURL is the scheme+host+port of the web application (eg https://www.happiness.com:8080) for url generation. No trailing slash.
|
||||
RootURL string
|
||||
// BCryptCost is the cost of the bcrypt password hashing function.
|
||||
BCryptCost int
|
||||
|
||||
@ -77,7 +77,7 @@ func NewConfig() *Config {
|
||||
return &Config{
|
||||
MountPath: "/",
|
||||
ViewsPath: "/",
|
||||
HostName: "localhost:8080",
|
||||
RootURL: "http://localhost:8080",
|
||||
BCryptCost: bcrypt.DefaultCost,
|
||||
|
||||
PrimaryID: StoreEmail,
|
||||
|
@ -129,7 +129,7 @@ var goConfirmEmail = func(c *Confirm, to, token string) {
|
||||
// confirmEmail sends a confirmation e-mail.
|
||||
func (c *Confirm) confirmEmail(to, token string) {
|
||||
p := path.Join(authboss.Cfg.MountPath, "confirm")
|
||||
url := fmt.Sprintf("%s%s?%s=%s", authboss.Cfg.HostName, p, url.QueryEscape(FormValueConfirm), url.QueryEscape(token))
|
||||
url := fmt.Sprintf("%s%s?%s=%s", authboss.Cfg.RootURL, p, url.QueryEscape(FormValueConfirm), url.QueryEscape(token))
|
||||
|
||||
email := authboss.Email{
|
||||
To: []string{to},
|
||||
|
@ -183,7 +183,7 @@ var goRecoverEmail = func(r *Recover, to, encodedToken string) {
|
||||
|
||||
func (r *Recover) sendRecoverEmail(to, encodedToken string) {
|
||||
p := path.Join(authboss.Cfg.MountPath, "recover/complete")
|
||||
url := fmt.Sprintf("%s%s?token=%s", authboss.Cfg.HostName, p, encodedToken)
|
||||
url := fmt.Sprintf("%s%s?token=%s", authboss.Cfg.RootURL, p, encodedToken)
|
||||
|
||||
email := authboss.Email{
|
||||
To: []string{to},
|
||||
|
Loading…
x
Reference in New Issue
Block a user