Skip to content

Commit

Permalink
include code in invite form instead of getting from url
Browse files Browse the repository at this point in the history
potentially solves #34?
  • Loading branch information
hrfee committed Jan 14, 2021
1 parent 3c799b8 commit a102199
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions html/form-base.html
Expand Up @@ -4,6 +4,7 @@
window.validationStrings = JSON.parse({{ .lang.validationStrings }});
window.invalidPassword = "{{ .lang.reEnterPasswordInvalid }}";
window.URLBase = "{{ .urlBase }}";
window.code = "{{ .code }}";
</script>
<script src="js/form.js" type="module"></script>
{{ end }}
3 changes: 2 additions & 1 deletion ts/form.ts
Expand Up @@ -5,6 +5,7 @@ interface formWindow extends Window {
validationStrings: pwValStrings;
invalidPassword: string;
modal: Modal;
code: string;
}

interface pwValString {
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions views.go
Expand Up @@ -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{
Expand Down

0 comments on commit a102199

Please sign in to comment.