diff --git a/html/form-base.html b/html/form-base.html index 432d6a4..df49c4b 100644 --- a/html/form-base.html +++ b/html/form-base.html @@ -4,6 +4,7 @@ window.validationStrings = JSON.parse({{ .lang.validationStrings }}); window.invalidPassword = "{{ .lang.reEnterPasswordInvalid }}"; window.URLBase = "{{ .urlBase }}"; + window.code = "{{ .code }}"; {{ end }} diff --git a/ts/form.ts b/ts/form.ts index 4d7666c..d5301bb 100644 --- a/ts/form.ts +++ b/ts/form.ts @@ -5,6 +5,7 @@ interface formWindow extends Window { validationStrings: pwValStrings; invalidPassword: string; modal: Modal; + code: string; } interface pwValString { @@ -103,7 +104,7 @@ const create = (event: SubmitEvent) => { event.preventDefault(); toggleLoader(submitSpan); let send: sendDTO = { - code: window.location.href.split('/').pop(), + code: window.code, username: usernameField.value, email: emailField.value, password: passwordField.value diff --git a/views.go b/views.go index 7f54628..50b038e 100644 --- a/views.go +++ b/views.go @@ -56,6 +56,7 @@ func (app *appContext) InviteProxy(gc *gin.Context) { "email": email, "username": !app.config.Section("email").Key("no_username").MustBool(false), "lang": app.storage.lang.Form[lang]["strings"], + "code": code, }) } else { gcHTML(gc, 404, "invalidCode.html", gin.H{