diff --git a/handler/error/error.go b/handler/error/error.go deleted file mode 100644 index cc1819d..0000000 --- a/handler/error/error.go +++ /dev/null @@ -1,28 +0,0 @@ -package errorHandler - -import ( - "fmt" - "github.com/fossyy/filekeeper/app" - "github.com/fossyy/filekeeper/view/client/error" - "net/http" -) - -func NotFound(w http.ResponseWriter, r *http.Request) { - component := errorView.NotFound("Not Found") - err := component.Render(r.Context(), w) - if err != nil { - fmt.Fprint(w, err.Error()) - app.Server.Logger.Error(err.Error()) - return - } -} - -func InternalServerError(w http.ResponseWriter, r *http.Request) { - component := errorView.InternalServerError("Internal Server Error") - err := component.Render(r.Context(), w) - if err != nil { - fmt.Fprint(w, err.Error()) - app.Server.Logger.Error(err.Error()) - return - } -} diff --git a/middleware/middleware.go b/middleware/middleware.go index 7585385..03b7f1e 100644 --- a/middleware/middleware.go +++ b/middleware/middleware.go @@ -4,10 +4,10 @@ import ( "context" "fmt" "github.com/fossyy/filekeeper/app" + errorView "github.com/fossyy/filekeeper/view/client/error" "net/http" "strings" - errorHandler "github.com/fossyy/filekeeper/handler/error" "github.com/fossyy/filekeeper/session" "github.com/fossyy/filekeeper/utils" ) @@ -24,14 +24,24 @@ func (w *wrapper) WriteHeader(code int) { if code == http.StatusNotFound { w.Header().Set("Content-Type", "text/html") w.ResponseWriter.WriteHeader(code) - errorHandler.NotFound(w.ResponseWriter, w.request) + component := errorView.NotFound("Not Found") + err := component.Render(w.request.Context(), w) + if err != nil { + app.Server.Logger.Error(err.Error()) + return + } return } if code == http.StatusInternalServerError { w.Header().Set("Content-Type", "text/html") w.ResponseWriter.WriteHeader(code) - errorHandler.InternalServerError(w.ResponseWriter, w.request) + component := errorView.InternalServerError("Internal Server Error") + err := component.Render(w.request.Context(), w) + if err != nil { + app.Server.Logger.Error(err.Error()) + return + } return } w.ResponseWriter.WriteHeader(code) @@ -80,78 +90,82 @@ func Handler(next http.Handler) http.Handler { }) } -func Auth(next http.HandlerFunc, w http.ResponseWriter, r *http.Request) { - status, user, sessionID := session.GetSession(r) +func Auth(next http.HandlerFunc) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + status, user, sessionID := session.GetSession(r) - switch status { - case session.Authorized: - ctx := context.WithValue(r.Context(), "user", user) - ctx = context.WithValue(ctx, "sessionID", sessionID) - req := r.WithContext(ctx) - next.ServeHTTP(w, req) - return - case session.Unauthorized: - if r.RequestURI != "/logout" { + switch status { + case session.Authorized: + ctx := context.WithValue(r.Context(), "user", user) + ctx = context.WithValue(ctx, "sessionID", sessionID) + req := r.WithContext(ctx) + next.ServeHTTP(w, req) + return + case session.Unauthorized: + if r.RequestURI != "/logout" { + http.SetCookie(w, &http.Cookie{ + Name: "redirect", + Value: r.RequestURI, + Path: "/", + }) + } + http.Redirect(w, r, "/signin", http.StatusSeeOther) + return + case session.InvalidSession: http.SetCookie(w, &http.Cookie{ - Name: "redirect", - Value: r.RequestURI, - Path: "/", + Name: "Session", + Value: "", + Path: "/", + MaxAge: -1, }) - } - http.Redirect(w, r, "/signin", http.StatusSeeOther) - return - case session.InvalidSession: - http.SetCookie(w, &http.Cookie{ - Name: "Session", - Value: "", - Path: "/", - MaxAge: -1, - }) - http.Redirect(w, r, "/signin", http.StatusSeeOther) - return - case session.Suspicious: - userSession := session.Get(sessionID) - err := userSession.Delete() - if err != nil { - app.Server.Logger.Error(err) - } - err = session.RemoveSessionInfo(user.Email, sessionID) - if err != nil { - app.Server.Logger.Error(err) + http.Redirect(w, r, "/signin", http.StatusSeeOther) + return + case session.Suspicious: + userSession := session.Get(sessionID) + err := userSession.Delete() + if err != nil { + app.Server.Logger.Error(err) + } + err = session.RemoveSessionInfo(user.Email, sessionID) + if err != nil { + app.Server.Logger.Error(err) + return + } + http.SetCookie(w, &http.Cookie{ + Name: "Session", + Value: "", + Path: "/", + MaxAge: -1, + }) + http.Redirect(w, r, "/signin?error=suspicious_session", http.StatusSeeOther) + return + default: + http.Redirect(w, r, "/", http.StatusSeeOther) return } - http.SetCookie(w, &http.Cookie{ - Name: "Session", - Value: "", - Path: "/", - MaxAge: -1, - }) - http.Redirect(w, r, "/signin?error=suspicious_session", http.StatusSeeOther) - return - default: - http.Redirect(w, r, "/", http.StatusSeeOther) - return - } + }) } -func Guest(next http.HandlerFunc, w http.ResponseWriter, r *http.Request) { - status, _, _ := session.GetSession(r) +func Guest(next http.HandlerFunc) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + status, _, _ := session.GetSession(r) - switch status { - case session.Authorized: - http.Redirect(w, r, "/", http.StatusSeeOther) - return - case session.Unauthorized: - next.ServeHTTP(w, r) - return - case session.InvalidSession: - http.SetCookie(w, &http.Cookie{ - Name: "Session", - Value: "", - Path: "/", - MaxAge: -1, - }) - next.ServeHTTP(w, r) - return - } + switch status { + case session.Authorized: + http.Redirect(w, r, "/", http.StatusSeeOther) + return + case session.Unauthorized: + next.ServeHTTP(w, r) + return + case session.InvalidSession: + http.SetCookie(w, &http.Cookie{ + Name: "Session", + Value: "", + Path: "/", + MaxAge: -1, + }) + next.ServeHTTP(w, r) + return + } + }) } diff --git a/routes/client/routes.go b/routes/client/routes.go index cadb653..edefffa 100644 --- a/routes/client/routes.go +++ b/routes/client/routes.go @@ -1,8 +1,6 @@ package client import ( - "fmt" - "github.com/fossyy/filekeeper/app" googleOauthHandler "github.com/fossyy/filekeeper/handler/auth/google" googleOauthCallbackHandler "github.com/fossyy/filekeeper/handler/auth/google/callback" googleOauthSetupHandler "github.com/fossyy/filekeeper/handler/auth/google/setup" @@ -33,156 +31,57 @@ import ( func SetupRoutes() *http.ServeMux { handler := http.NewServeMux() - handler.HandleFunc("GET /{$}", func(w http.ResponseWriter, r *http.Request) { - indexHandler.GET(w, r) - }) - - handler.HandleFunc("GET /auth/google", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(googleOauthHandler.GET, w, r) - }) - - handler.HandleFunc("GET /auth/totp", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(totpHandler.GET, w, r) - }) - - handler.HandleFunc("POST /auth/totp", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(totpHandler.POST, w, r) - }) - - handler.HandleFunc("GET /auth/google/callback", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(googleOauthCallbackHandler.GET, w, r) - }) - - handler.HandleFunc("GET /auth/google/setup/{code}", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(googleOauthSetupHandler.GET, w, r) - }) - handler.HandleFunc("POST /auth/google/setup/{code}", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(googleOauthSetupHandler.POST, w, r) - }) - - handler.HandleFunc("GET /signin", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(signinHandler.GET, w, r) - }) - - handler.HandleFunc("POST /signin", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(signinHandler.POST, w, r) - }) - - handler.HandleFunc("GET /signup", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(signupHandler.GET, w, r) - }) - - handler.HandleFunc("POST /signup", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(signupHandler.POST, w, r) - }) - - handler.HandleFunc("GET /signup/verify/{code}", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(signupVerifyHandler.GET, w, r) - }) - - handler.HandleFunc("GET /forgot-password", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(forgotPasswordHandler.GET, w, r) - }) - - handler.HandleFunc("POST /forgot-password", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(forgotPasswordHandler.POST, w, r) - }) - - handler.HandleFunc("GET /forgot-password/verify/{code}", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(forgotPasswordVerifyHandler.GET, w, r) - }) - - handler.HandleFunc("POST /forgot-password/verify/{code}", func(w http.ResponseWriter, r *http.Request) { - middleware.Guest(forgotPasswordVerifyHandler.POST, w, r) - }) - - handler.HandleFunc("GET /user", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(userHandler.GET, w, r) - }) - - handler.HandleFunc("POST /user/reset-password", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(userHandlerResetPassword.POST, w, r) - }) - - handler.HandleFunc("DELETE /user/session/terminate/{id}", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(userSessionTerminateHandler.DELETE, w, r) - }) - - handler.HandleFunc("GET /user/totp/setup", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(userHandlerTotpSetup.GET, w, r) - }) - - handler.HandleFunc("POST /user/totp/setup", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(userHandlerTotpSetup.POST, w, r) - }) - - handler.HandleFunc("GET /file", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(fileHandler.GET, w, r) - }) - - handler.HandleFunc("GET /file/table", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(fileTableHandler.GET, w, r) - }) - - handler.HandleFunc("GET /file/query", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(queryHandler.GET, w, r) - }) - - handler.HandleFunc("POST /file/{id}", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(uploadHandler.POST, w, r) - }) - - handler.HandleFunc("DELETE /file/{id}", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(deleteHandler.DELETE, w, r) - }) - - handler.HandleFunc("GET /file/{id}", func(w http.ResponseWriter, r *http.Request) { - downloadHandler.GET(w, r) - }) - - handler.HandleFunc("PUT /file/{id}", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(visibilityHandler.PUT, w, r) - }) - - handler.HandleFunc("PATCH /file/{id}", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(renameFileHandler.PATCH, w, r) - }) - - handler.HandleFunc("GET /logout", func(w http.ResponseWriter, r *http.Request) { - middleware.Auth(logoutHandler.GET, w, r) - }) + // Index + handler.HandleFunc("GET /{$}", indexHandler.GET) + + // Auth Routes + handler.Handle("GET /auth/google", middleware.Guest(googleOauthHandler.GET)) + handler.Handle("GET /auth/totp", middleware.Guest(totpHandler.GET)) + handler.Handle("POST /auth/totp", middleware.Guest(totpHandler.POST)) + handler.Handle("GET /auth/google/callback", middleware.Guest(googleOauthCallbackHandler.GET)) + handler.Handle("GET /auth/google/setup/{code}", middleware.Guest(googleOauthSetupHandler.GET)) + handler.Handle("POST /auth/google/setup/{code}", middleware.Guest(googleOauthSetupHandler.POST)) + + // Signin/Signup/Forgot Password + handler.Handle("GET /signin", middleware.Guest(signinHandler.GET)) + handler.Handle("POST /signin", middleware.Guest(signinHandler.POST)) + handler.Handle("GET /signup", middleware.Guest(signupHandler.GET)) + handler.Handle("POST /signup", middleware.Guest(signupHandler.POST)) + handler.Handle("GET /signup/verify/{code}", middleware.Guest(signupVerifyHandler.GET)) + handler.Handle("GET /forgot-password", middleware.Guest(forgotPasswordHandler.GET)) + handler.Handle("POST /forgot-password", middleware.Guest(forgotPasswordHandler.POST)) + handler.Handle("GET /forgot-password/verify/{code}", middleware.Guest(forgotPasswordVerifyHandler.GET)) + handler.Handle("POST /forgot-password/verify/{code}", middleware.Guest(forgotPasswordVerifyHandler.POST)) + + // User Routes + handler.Handle("GET /user", middleware.Auth(userHandler.GET)) + handler.Handle("POST /user/reset-password", middleware.Auth(userHandlerResetPassword.POST)) + handler.Handle("DELETE /user/session/terminate/{id}", middleware.Auth(userSessionTerminateHandler.DELETE)) + handler.Handle("GET /user/totp/setup", middleware.Auth(userHandlerTotpSetup.GET)) + handler.Handle("POST /user/totp/setup", middleware.Auth(userHandlerTotpSetup.POST)) + + // File Routes + handler.Handle("GET /file", middleware.Auth(fileHandler.GET)) + handler.Handle("GET /file/table", middleware.Auth(fileTableHandler.GET)) + handler.Handle("GET /file/query", middleware.Auth(queryHandler.GET)) + handler.Handle("POST /file/{id}", middleware.Auth(uploadHandler.POST)) + handler.Handle("DELETE /file/{id}", middleware.Auth(deleteHandler.DELETE)) + handler.HandleFunc("GET /file/{id}", downloadHandler.GET) + handler.Handle("PUT /file/{id}", middleware.Auth(visibilityHandler.PUT)) + handler.Handle("PATCH /file/{id}", middleware.Auth(renameFileHandler.PATCH)) + + handler.Handle("GET /logout", middleware.Auth(logoutHandler.GET)) handler.HandleFunc("GET /robots.txt", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, "public/robots.txt") }) - handler.HandleFunc("GET /sitemap.xml", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, "public/sitemap.xml") }) - handler.HandleFunc("GET /favicon.ico", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, "public/favicon.ico") }) - handler.HandleFunc("GET /test", func(w http.ResponseWriter, r *http.Request) { - objects, err := app.Server.Storage.ListObjects(r.Context(), "test/") - fmt.Println(objects) - if err != nil { - return - } - if r.URL.Query().Get("new") != "" { - app.Server.Storage.Add(r.Context(), "test.txt", []byte(r.URL.Query().Get("new"))) - w.Write([]byte("succes")) - return - } - get, err := app.Server.Storage.Get(r.Context(), "test.txt") - if err != nil { - w.WriteHeader(http.StatusInternalServerError) - return - } - w.Write(get) - }) - fileServer := http.FileServer(http.Dir("./public")) handler.Handle("/public/", http.StripPrefix("/public", fileServer)) diff --git a/view/admin/index/index_templ.go b/view/admin/index/index_templ.go index c733a61..8ca0ebf 100644 --- a/view/admin/index/index_templ.go +++ b/view/admin/index/index_templ.go @@ -43,7 +43,7 @@ func Main() templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

System Usage

Real-time metrics for your server.

0%
CPU Usage
0GB
Memory Usage
0Mbps
Upload Speed
0Mbps
Download Speed

User List

Manage your registered users.

NameEmailRoleActions
John Doe
john@example.com
Admin
Jane Smith
jane@example.com
Editor
Bob Johnson
bob@example.com
User

Server Control

Manage your server instances.

Server 1
192.168.1.100
Server 2
192.168.1.101
Server 3
192.168.1.102

Server Environment

Manage your server environment variables.

NODE_ENV
Environment mode
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/admin/layout/base_templ.go b/view/admin/layout/base_templ.go index 2177222..2c65a26 100644 --- a/view/admin/layout/base_templ.go +++ b/view/admin/layout/base_templ.go @@ -29,7 +29,7 @@ func Base() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Admin Page
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -37,7 +37,7 @@ func Base() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/client/auth/auth_templ.go b/view/client/auth/auth_templ.go index 0c9ad5f..4b6b9c0 100644 --- a/view/client/auth/auth_templ.go +++ b/view/client/auth/auth_templ.go @@ -46,13 +46,13 @@ func form(err types.Message, title string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Set Up Your Account

Enter your information to create a new account

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } switch err.Code { case 0: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -65,12 +65,12 @@ func form(err types.Message, title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 3) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } case 1: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 4) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -83,12 +83,12 @@ func form(err types.Message, title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 5) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • Passwords do not match
  • Password must contain at least one uppercase letter
  • Password length must be at least 8 characters
Already have an account? Sign in
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 6) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/client/email/email_templ.go b/view/client/email/email_templ.go index 8809b84..45d9eab 100644 --- a/view/client/email/email_templ.go +++ b/view/client/email/email_templ.go @@ -29,7 +29,7 @@ func RegistrationEmail(name string, link string) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Email Verification

Email Verification

Dear ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -42,7 +42,7 @@ func RegistrationEmail(name string, link string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(",

Please verify your email address by clicking the button below:

Verify Email

Or copy and paste this URL into a new tab of your browser:
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 4) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -73,7 +73,7 @@ func RegistrationEmail(name string, link string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

If you did not request this verification, please disregard this email.

Thank you,
The Filekeeper Team

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 5) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -102,7 +102,7 @@ func ForgotPassword(name string, link string) templ.Component { templ_7745c5c3_Var6 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Email Verification

Password Change Request

Dear ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 6) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -115,7 +115,7 @@ func ForgotPassword(name string, link string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(",

Please verify your password change request by clicking the button below:

Verify Password Change

Or copy and paste this URL into a new tab of your browser:
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 9) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -146,7 +146,7 @@ func ForgotPassword(name string, link string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

If you did not request this password change, please disregard this email.

Thank you,
The Filekeeper Team

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 10) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/client/error/error_templ.go b/view/client/error/error_templ.go index 2fd7888..1b74d1a 100644 --- a/view/client/error/error_templ.go +++ b/view/client/error/error_templ.go @@ -43,7 +43,7 @@ func NotFound(title string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

404 Not Found

The page you are looking for does not exist. It might have been moved or deleted.

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -90,7 +90,7 @@ func InternalServerError(title string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Cute

Oops! Something went wrong.

We're sorry, but an internal server error has occurred. Please try again later.

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/client/forgotPassword/forgotPassword_templ.go b/view/client/forgotPassword/forgotPassword_templ.go index 0a7b1e2..3ad1279 100644 --- a/view/client/forgotPassword/forgotPassword_templ.go +++ b/view/client/forgotPassword/forgotPassword_templ.go @@ -46,13 +46,13 @@ func content(title string, err types.Message) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Forgot password

Enter your email below to reset your password

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } switch err.Code { case 0: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -65,12 +65,12 @@ func content(title string, err types.Message) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 3) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 4) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -146,13 +146,13 @@ func NewPasswordForm(title string, err types.Message) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Forgot password

Enter your email below to reset your password

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 5) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } switch err.Code { case 0: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 6) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -165,12 +165,12 @@ func NewPasswordForm(title string, err types.Message) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 7) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • Passwords do not match
  • Password must contain at least one uppercase letter
  • Password length must be at least 8 characters
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 8) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -217,7 +217,7 @@ func EmailSend(title string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Email Verification Sent

We've sent a verification email to your inbox. Please check your email and follow the instructions to change your password.

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 9) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -264,7 +264,7 @@ func ChangeSuccess(title string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Password Changed Successfully

Your password has been successfully updated. Feel free to continue enjoying our platform.

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 10) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/client/index/index_templ.go b/view/client/index/index_templ.go index d8d14b5..51a7ce8 100644 --- a/view/client/index/index_templ.go +++ b/view/client/index/index_templ.go @@ -46,7 +46,7 @@ func content(title string, user types.User) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -54,37 +54,37 @@ func content(title string, user types.User) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Your files, always within reach

Store, access, and manage your files with ease. Filekeeper offers generous storage and seamless access from any device, completely free.

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if user.Authenticated { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Open Dashboard") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 3) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Sign up for free") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 4) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Easy Access

Access your files with just a few clicks, anytime you need them.

Generous Storage

Store all your important files with our spacious free storage.

Access Anywhere

Use Filekeeper on any device - computer, tablet, or smartphone.

Secure Storage

Rest easy knowing your files are stored securely in the cloud.

Why choose Filekeeper?

  • Completely free to use
  • Intuitive and user-friendly interface
  • Generous storage space for all your files
  • Access your files from any device, anywhere
  • Robust file organization and search capabilities
  • Dedicated customer support team

Get Started with Filekeeper

Join Filekeeper today and experience hassle-free file management - no credit card required!

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 5) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if user.Authenticated { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Open Dashboard") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 6) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Create your free account") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 7) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 8) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -92,7 +92,7 @@ func content(title string, user types.User) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 9) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/client/layout/base_templ.go b/view/client/layout/base_templ.go index 8970b4e..7797039 100644 --- a/view/client/layout/base_templ.go +++ b/view/client/layout/base_templ.go @@ -31,7 +31,7 @@ func Base(title string) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -44,7 +44,7 @@ func Base(title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -52,7 +52,7 @@ func Base(title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 3) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -60,7 +60,7 @@ func Base(title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 4) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -72,7 +72,7 @@ func Base(title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 5) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -101,7 +101,7 @@ func BaseAuth(title string) templ.Component { templ_7745c5c3_Var3 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 6) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -114,7 +114,7 @@ func BaseAuth(title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 7) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -122,7 +122,7 @@ func BaseAuth(title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 8) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -130,7 +130,7 @@ func BaseAuth(title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 9) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -146,7 +146,7 @@ func BaseAuth(title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 10) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -175,7 +175,7 @@ func modal() templ.Component { templ_7745c5c3_Var5 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 11) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -204,7 +204,7 @@ func uploadBox() templ.Component { templ_7745c5c3_Var6 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Mengupload 1 item
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 12) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -233,7 +233,7 @@ func MainScript() templ.Component { templ_7745c5c3_Var7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 13) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -262,7 +262,7 @@ func modalScript() templ.Component { templ_7745c5c3_Var8 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 14) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -291,12 +291,12 @@ func Navbar(user types.User) templ.Component { templ_7745c5c3_Var9 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Filekeeper Filekeeper
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 15) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if user.Authenticated { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 18) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Sign up Sign in") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 19) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 20) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -361,7 +361,7 @@ func Footer() templ.Component { templ_7745c5c3_Var12 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 21) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/client/signin/signin_templ.go b/view/client/signin/signin_templ.go index 9c212ad..8d62c81 100644 --- a/view/client/signin/signin_templ.go +++ b/view/client/signin/signin_templ.go @@ -46,13 +46,13 @@ func content(err types.Message, title string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Sign In

Enter your email or username below to login to your account

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } switch err.Code { case 0: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -65,12 +65,12 @@ func content(err types.Message, title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 3) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

OR

Google-colorCreated with Sketch. Continue with Google
Don't have an account? Sign up
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 4) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/client/signup/signup_templ.go b/view/client/signup/signup_templ.go index dc516c5..49b5593 100644 --- a/view/client/signup/signup_templ.go +++ b/view/client/signup/signup_templ.go @@ -46,13 +46,13 @@ func form(err types.Message, title string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Sign Up

Enter your information to create an account

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } switch err.Code { case 0: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -65,12 +65,12 @@ func form(err types.Message, title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 3) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } case 1: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 4) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -83,12 +83,12 @@ func form(err types.Message, title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 5) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • Passwords do not match
  • Password must contain at least one uppercase letter
  • Password length must be at least 8 characters
Already have an account? Sign in
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 6) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -164,7 +164,7 @@ func EmailSend(title string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Email Verification Sent

We've sent a verification email to your inbox. Please check your email and follow the instructions to verify your account.

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 7) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -211,7 +211,7 @@ func VerifySuccess(title string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Account Verified

Your account has been successfully verified. You can now access all the features of our platform.

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 8) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/client/totp/totp_templ.go b/view/client/totp/totp_templ.go index 0084017..d65c6d9 100644 --- a/view/client/totp/totp_templ.go +++ b/view/client/totp/totp_templ.go @@ -46,13 +46,13 @@ func content(title string, msg types.Message) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } switch msg.Code { case 0: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Info
Error! ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -65,12 +65,12 @@ func content(title string, msg types.Message) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 3) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Verify Your Identity

Please enter the 6-digit code generated by your authentication app to complete the login process.

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 4) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/client/user/totp/setup_templ.go b/view/client/user/totp/setup_templ.go index 09680d5..7cdd232 100644 --- a/view/client/user/totp/setup_templ.go +++ b/view/client/user/totp/setup_templ.go @@ -81,7 +81,7 @@ func MainContent(title string, qrcode string, code string, user types.User, msg templ_7745c5c3_Var3 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -94,7 +94,7 @@ func MainContent(title string, qrcode string, code string, user types.User, msg if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -102,13 +102,13 @@ func MainContent(title string, qrcode string, code string, user types.User, msg if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Back

Set up Two-Factor Authentication

Secure your account with time-based one-time passwords (TOTP).

Here's how to set up the Google Authenticator app:

  1. Download the Google Authenticator app on your mobile device.
  2. Open the app and tap \"Begin Setup\".
  3. Select \"Scan a barcode\" and point your camera at the QR code below.
  4. The app will automatically add your account and display a 6-digit code.
  5. Enter this code on the website to complete the setup.
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 3) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } switch msg.Code { case 0: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Info
Error! ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 4) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -121,12 +121,12 @@ func MainContent(title string, qrcode string, code string, user types.User, msg if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 5) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } case 1: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Info
Success! ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 6) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -139,12 +139,12 @@ func MainContent(title string, qrcode string, code string, user types.User, msg if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 7) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"QR

Backup Code:

----|----

TOTP Secret:

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 9) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -170,7 +170,7 @@ func MainContent(title string, qrcode string, code string, user types.User, msg if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 11) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/client/user/user_templ.go b/view/client/user/user_templ.go index 5916534..a03b241 100644 --- a/view/client/user/user_templ.go +++ b/view/client/user/user_templ.go @@ -82,7 +82,7 @@ func MainContent(title string, user types.User, allowance *types.Allowance, List templ_7745c5c3_Var3 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -95,7 +95,7 @@ func MainContent(title string, user types.User, allowance *types.Allowance, List if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -103,7 +103,7 @@ func MainContent(title string, user types.User, allowance *types.Allowance, List if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Profile

JL

Session Management

Setup
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 5) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } for _, session := range ListSession { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 12) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
IP AddressBrowserDeviceActions
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 7) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -160,7 +160,7 @@ func MainContent(title string, user types.User, allowance *types.Allowance, List if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 8) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -173,7 +173,7 @@ func MainContent(title string, user types.User, allowance *types.Allowance, List if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 9) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -186,7 +186,7 @@ func MainContent(title string, user types.User, allowance *types.Allowance, List if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Reset Password

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 13) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } switch message.Code { case 0: - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 14) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -236,12 +236,12 @@ func MainContent(title string, user types.User, allowance *types.Allowance, List if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 15) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • New Passwords do not match
  • New Password must contain at least one uppercase letter
  • New Password length must be at least 8 characters

Click to log out or terminate the current session.

Storage Usage

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 16) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -254,7 +254,7 @@ func MainContent(title string, user types.User, allowance *types.Allowance, List if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" / ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 17) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -267,7 +267,7 @@ func MainContent(title string, user types.User, allowance *types.Allowance, List if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Manage

Upgrade Storage

Pro Plan

50GB of storage for $9.99/month

Upgrade

Enterprise Plan

1TB of storage for $49.99/month

Upgrade
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 18) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -279,7 +279,7 @@ func MainContent(title string, user types.User, allowance *types.Allowance, List if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 19) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -287,7 +287,7 @@ func MainContent(title string, user types.User, allowance *types.Allowance, List if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 20) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err }