mirror of https://github.com/muety/wakapi.git
Removes "Create account" button allowSignup false
This commit is contained in:
parent
3758eecc96
commit
598c32f67c
|
@ -1,9 +1,10 @@
|
|||
package view
|
||||
|
||||
type LoginViewModel struct {
|
||||
Success string
|
||||
Error string
|
||||
TotalUsers int
|
||||
Success string
|
||||
Error string
|
||||
TotalUsers int
|
||||
AllowSignup bool
|
||||
}
|
||||
|
||||
type SetPasswordViewModel struct {
|
||||
|
|
|
@ -299,10 +299,12 @@ func (h *LoginHandler) PostResetPassword(w http.ResponseWriter, r *http.Request)
|
|||
|
||||
func (h *LoginHandler) buildViewModel(r *http.Request) *view.LoginViewModel {
|
||||
numUsers, _ := h.userSrvc.Count()
|
||||
allowSignup := h.config.Security.AllowSignup
|
||||
|
||||
return &view.LoginViewModel{
|
||||
Success: r.URL.Query().Get("success"),
|
||||
Error: r.URL.Query().Get("error"),
|
||||
TotalUsers: int(numUsers),
|
||||
Success: r.URL.Query().Get("success"),
|
||||
Error: r.URL.Query().Get("error"),
|
||||
TotalUsers: int(numUsers),
|
||||
AllowSignup: allowSignup,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,9 +83,11 @@
|
|||
<a href="login">
|
||||
<button type="button" class="btn-default">Log in</button>
|
||||
</a>
|
||||
{{ if eq .AllowSignup true }}
|
||||
<button type="submit" class="btn-primary">
|
||||
Create Account
|
||||
</button>
|
||||
{{ end }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue