auth: source cookie hostname from jfa_url

instead of just applying the cookie to the hostname you accessed jfa-go
on, it is applied to the one you set in jfa-go. The result is you'll
have to login twice if you access on localhost:8056 instead
of accounts.jellyf.in.
This commit is contained in:
Harvey Tindall
2024-08-13 20:39:06 +01:00
parent e71d492495
commit b2771e6cc5
11 changed files with 1426 additions and 672 deletions

View File

@@ -325,7 +325,7 @@ func (emailer *Emailer) confirmationValues(code, username, key string, app *appC
}
} else {
message := app.config.Section("messages").Key("message").String()
inviteLink := app.ExternalHost
inviteLink := app.ExternalURI
if code == "" { // Personal email change
inviteLink = fmt.Sprintf("%s/my/confirm/%s", inviteLink, url.PathEscape(key))
} else { // Invite email confirmation
@@ -393,7 +393,7 @@ func (emailer *Emailer) inviteValues(code string, invite Invite, app *appContext
expiry := invite.ValidTill
d, t, expiresIn := emailer.formatExpiry(expiry, false, app.datePattern, app.timePattern)
message := app.config.Section("messages").Key("message").String()
inviteLink := fmt.Sprintf("%s/invite/%s", app.ExternalHost, code)
inviteLink := fmt.Sprintf("%s/invite/%s", app.ExternalURI, code)
template := map[string]interface{}{
"hello": emailer.lang.InviteEmail.get("hello"),
"youHaveBeenInvited": emailer.lang.InviteEmail.get("youHaveBeenInvited"),