Compare commits

..

1 Commits

Author SHA1 Message Date
Hayden
36b728424c fix #285 2023-02-15 08:44:53 -09:00
7 changed files with 14 additions and 27 deletions

View File

@@ -2,7 +2,6 @@ version: "3"
env:
HBOX_STORAGE_SQLITE_URL: .data/homebox.db?_fk=1
HBOX_OPTIONS_ALLOW_REGISTRATION: true
UNSAFE_DISABLE_PASSWORD_PROJECTION: "yes_i_am_sure"
tasks:
setup:

View File

@@ -44,13 +44,12 @@ type (
}
ApiSummary struct {
Healthy bool `json:"health"`
Versions []string `json:"versions"`
Title string `json:"title"`
Message string `json:"message"`
Build Build `json:"build"`
Demo bool `json:"demo"`
AllowRegistration bool `json:"allowRegistration"`
Healthy bool `json:"health"`
Versions []string `json:"versions"`
Title string `json:"title"`
Message string `json:"message"`
Build Build `json:"build"`
Demo bool `json:"demo"`
}
)
@@ -83,12 +82,11 @@ func NewControllerV1(svc *services.AllServices, repos *repo.AllRepos, options ..
func (ctrl *V1Controller) HandleBase(ready ReadyFunc, build Build) server.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) error {
return server.Respond(w, http.StatusOK, ApiSummary{
Healthy: ready(),
Title: "Go API Template",
Message: "Welcome to the Go API Template Application!",
Build: build,
Demo: ctrl.isDemo,
AllowRegistration: ctrl.allowRegistration,
Healthy: ready(),
Title: "Go API Template",
Message: "Welcome to the Go API Template Application!",
Build: build,
Demo: ctrl.isDemo,
})
}
}

View File

@@ -2425,9 +2425,6 @@ const docTemplate = `{
"v1.ApiSummary": {
"type": "object",
"properties": {
"allowRegistration": {
"type": "boolean"
},
"build": {
"$ref": "#/definitions/v1.Build"
},

View File

@@ -2417,9 +2417,6 @@
"v1.ApiSummary": {
"type": "object",
"properties": {
"allowRegistration": {
"type": "boolean"
},
"build": {
"$ref": "#/definitions/v1.Build"
},

View File

@@ -564,8 +564,6 @@ definitions:
type: object
v1.ApiSummary:
properties:
allowRegistration:
type: boolean
build:
$ref: '#/definitions/v1.Build'
demo:

View File

@@ -335,7 +335,6 @@ export interface ActionAmountResult {
}
export interface ApiSummary {
allowRegistration: boolean;
build: Build;
demo: boolean;
health: boolean;

View File

@@ -101,6 +101,7 @@
toast.success("Logged in successfully");
// @ts-expect-error - expires is either a date or a string, need to figure out store typing
authStore.$patch({
token: data.token,
expires: data.expiresAt,
@@ -213,13 +214,11 @@
</Transition>
<div class="text-center mt-6">
<button
v-if="status && status.allowRegistration"
class="btn text-base-content text-lg hover:bg-primary hover:text-primary-content transition-colors duration-200"
class="text-base-content text-lg hover:bg-primary hover:text-primary-content px-3 py-1 rounded-xl transition-colors duration-200"
@click="() => toggleLogin()"
>
{{ registerForm ? "Login" : "Register" }}
{{ registerForm ? "Already a User? Login" : "Not a User? Register" }}
</button>
<p v-else class="text-base-content italic text-sm">Registration Disabled</p>
</div>
</div>
</div>