From f705d9538f0b2b74dcaf1ed5a01d263302a771c4 Mon Sep 17 00:00:00 2001 From: Bagas Aulia Rezki Date: Thu, 31 Oct 2024 15:55:48 +0700 Subject: [PATCH 1/2] Use correct path for air --- .air.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.air.toml b/.air.toml index 4c9eee1..9c6e261 100644 --- a/.air.toml +++ b/.air.toml @@ -4,12 +4,12 @@ tmp_dir = "tmp" [build] args_bin = [] - bin = "tmp\\main.exe --log true" + bin = "tmp/main.exe --log true" cmd = "go build -o ./tmp/main.exe ." delay = 1000 exclude_dir = ["assets", "tmp", "vendor", "testdata", "uploads"] exclude_file = [] - exclude_regex = ["_test.go"] + exclude_regex = ["_test.go"]git exclude_unchanged = false follow_symlink = false full_bin = "" From 197383c4143e658f1d97812024fd80cd9681c134 Mon Sep 17 00:00:00 2001 From: Bagas Aulia Rezki Date: Thu, 31 Oct 2024 16:24:32 +0700 Subject: [PATCH 2/2] Encrypt TOTP secret before saving to database --- app/app.go | 24 ++-- encryption/encryption.go | 76 ++++++++++++ handler/auth/totp/totp.go | 7 +- handler/user/totp/setup.go | 10 +- main.go | 5 +- types/types.go | 5 + utils/utils.go | 4 + view/admin/index/index_templ.go | 2 +- view/admin/layout/base_templ.go | 4 +- view/client/auth/auth_templ.go | 2 +- .../forgotPassword/forgotPassword_templ.go | 20 ++-- view/client/auth/signin/signin_templ.go | 8 +- view/client/auth/signup/signup_templ.go | 12 +- view/client/email/email_templ.go | 20 ++-- view/client/error/error_templ.go | 4 +- view/client/file/file_templ.go | 110 +++++++++--------- view/client/index/index_templ.go | 18 +-- view/client/layout/base_templ.go | 42 +++---- view/client/totp/totp_templ.go | 8 +- view/client/user/totp/setup_templ.go | 22 ++-- view/client/user/user_templ.go | 40 +++---- 21 files changed, 271 insertions(+), 172 deletions(-) create mode 100644 encryption/encryption.go diff --git a/app/app.go b/app/app.go index d0d4340..f1612fd 100644 --- a/app/app.go +++ b/app/app.go @@ -12,24 +12,26 @@ var Admin App type App struct { http.Server - Database types.Database - Cache types.CachingServer - Storage types.Storage - Logger *logger.AggregatedLogger - Mail *email.SmtpServer + Database types.Database + Cache types.CachingServer + Storage types.Storage + Encryption types.Encryption + Logger *logger.AggregatedLogger + Mail *email.SmtpServer } -func NewClientServer(addr string, handler http.Handler, logger logger.AggregatedLogger, database types.Database, cache types.CachingServer, storage types.Storage, mail email.SmtpServer) App { +func NewClientServer(addr string, handler http.Handler, logger logger.AggregatedLogger, database types.Database, cache types.CachingServer, encryption types.Encryption, storage types.Storage, mail email.SmtpServer) App { return App{ Server: http.Server{ Addr: addr, Handler: handler, }, - Storage: storage, - Logger: &logger, - Database: database, - Cache: cache, - Mail: &mail, + Storage: storage, + Logger: &logger, + Database: database, + Encryption: encryption, + Cache: cache, + Mail: &mail, } } diff --git a/encryption/encryption.go b/encryption/encryption.go new file mode 100644 index 0000000..5408f40 --- /dev/null +++ b/encryption/encryption.go @@ -0,0 +1,76 @@ +package encryption + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "encoding/base64" + "fmt" + "github.com/fossyy/filekeeper/types" + "github.com/fossyy/filekeeper/utils" +) + +type aesEncryption struct{} + +func NewAesEncryption() types.Encryption { + return &aesEncryption{} +} + +func (e *aesEncryption) Encrypt(enc string) (string, error) { + secret := utils.Getenv("ENCRYPTION_SECRET") + + aesCipher, err := aes.NewCipher([]byte(secret)) + + if err != nil { + return "", err + } + + gcm, err := cipher.NewGCM(aesCipher) + if err != nil { + return "", err + } + + nonce := make([]byte, gcm.NonceSize()) + _, err = rand.Read(nonce) + if err != nil { + return "", err + } + + ciphertext := gcm.Seal(nonce, nonce, []byte(enc), nil) + + ciphertextBase64 := base64.StdEncoding.EncodeToString(ciphertext) + + return ciphertextBase64, nil +} + +func (e *aesEncryption) Decrypt(dec string) (string, error) { + ciphertext, err := base64.StdEncoding.DecodeString(dec) + if err != nil { + return "", err + } + + secret := utils.Getenv("ENCRYPTION_SECRET") + if len(secret) != 16 && len(secret) != 24 && len(secret) != 32 { + return "", fmt.Errorf("invalid SECRET length: must be 16, 24, or 32 bytes") + } + + aesCipher, err := aes.NewCipher([]byte(secret)) + if err != nil { + return "", err + } + + gcm, err := cipher.NewGCM(aesCipher) + if err != nil { + return "", err + } + + nonceSize := gcm.NonceSize() + nonce, ciphertext := ciphertext[:nonceSize], ciphertext[nonceSize:] + + plaintext, err := gcm.Open(nil, nonce, ciphertext, nil) + if err != nil { + return "", fmt.Errorf("message authentication failed: %v", err) + } + + return string(plaintext), nil +} diff --git a/handler/auth/totp/totp.go b/handler/auth/totp/totp.go index 2508c48..c1ed0b5 100644 --- a/handler/auth/totp/totp.go +++ b/handler/auth/totp/totp.go @@ -39,7 +39,12 @@ func POST(w http.ResponseWriter, r *http.Request) { } code := r.Form.Get("code") _, user, key := session.GetSession(r) - totp := gotp.NewDefaultTOTP(user.Totp) + decryptedSecret, err := app.Server.Encryption.Decrypt(user.Totp) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + app.Server.Logger.Error(err.Error()) + } + totp := gotp.NewDefaultTOTP(decryptedSecret) if totp.Verify(code, time.Now().Unix()) { storeSession := session.Get(key) diff --git a/handler/user/totp/setup.go b/handler/user/totp/setup.go index 97c2356..286da2c 100644 --- a/handler/user/totp/setup.go +++ b/handler/user/totp/setup.go @@ -82,12 +82,18 @@ func POST(w http.ResponseWriter, r *http.Request) { } var component templ.Component if totp.Verify(code, time.Now().Unix()) { - if err := app.Server.Database.InitializeTotp(userSession.Email, secret); err != nil { + encryptedSecret, err := app.Server.Encryption.Encrypt(secret) + if err != nil { w.WriteHeader(http.StatusInternalServerError) app.Server.Logger.Error(err.Error()) return } - err := app.Server.Cache.RemoveUserCache(r.Context(), userSession.Email) + if err := app.Server.Database.InitializeTotp(userSession.Email, encryptedSecret); err != nil { + w.WriteHeader(http.StatusInternalServerError) + app.Server.Logger.Error(err.Error()) + return + } + err = app.Server.Cache.RemoveUserCache(r.Context(), userSession.Email) if err != nil { w.WriteHeader(http.StatusInternalServerError) app.Server.Logger.Error(err.Error()) diff --git a/main.go b/main.go index 83c94a0..4502db3 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,8 @@ package main import ( "fmt" + "github.com/fossyy/filekeeper/encryption" + "github.com/fossyy/filekeeper/logger" "github.com/fossyy/filekeeper/storage" "strconv" @@ -9,7 +11,6 @@ import ( "github.com/fossyy/filekeeper/cache" "github.com/fossyy/filekeeper/db" "github.com/fossyy/filekeeper/email" - "github.com/fossyy/filekeeper/logger" "github.com/fossyy/filekeeper/middleware" "github.com/fossyy/filekeeper/routes/admin" "github.com/fossyy/filekeeper/routes/client" @@ -42,7 +43,7 @@ func main() { secretKey := utils.Getenv("S3_SECRET_KEY") S3 := storage.NewS3(bucket, region, endpoint, accessKey, secretKey) - app.Server = app.NewClientServer(clientAddr, middleware.Handler(client.SetupRoutes()), *logger.Logger(), database, cacheServer, S3, mailServer) + app.Server = app.NewClientServer(clientAddr, middleware.Handler(client.SetupRoutes()), *logger.Logger(), database, cacheServer, encryption.NewAesEncryption(), S3, mailServer) app.Admin = app.NewAdminServer(adminAddr, middleware.Handler(admin.SetupRoutes()), database) go func() { diff --git a/types/types.go b/types/types.go index c57512f..698594a 100644 --- a/types/types.go +++ b/types/types.go @@ -107,3 +107,8 @@ type Storage interface { Delete(ctx context.Context, key string) error ListObjects(ctx context.Context, prefix string) ([]string, error) } + +type Encryption interface { + Encrypt(enc string) (string, error) + Decrypt(dec string) (string, error) +} diff --git a/utils/utils.go b/utils/utils.go index 42b1256..d2305dc 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -119,6 +119,10 @@ func Getenv(key string) string { val := os.Getenv(key) env.value[key] = val + if val == "" { + panic("Asking for env: " + key + " but got nothing, please set your environment first") + } + return val } diff --git a/view/admin/index/index_templ.go b/view/admin/index/index_templ.go index 25151ff..c01f3b4 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 4498e7a..4bf7b49 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 ebaf1b7..ad4d7b7 100644 --- a/view/client/auth/auth_templ.go +++ b/view/client/auth/auth_templ.go @@ -46,7 +46,7 @@ func form(err types.Message, title string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Sign Up

  • Passwords do not match
  • Password must contain at least one uppercase letter
  • Password length must be at least 8 characters

Already have an account? Log in

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/view/client/auth/forgotPassword/forgotPassword_templ.go b/view/client/auth/forgotPassword/forgotPassword_templ.go index cb3ba7b..8ea4d88 100644 --- a/view/client/auth/forgotPassword/forgotPassword_templ.go +++ b/view/client/auth/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 address and we'll send you instructions 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("
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, 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("

Reset 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("
Error! ") + 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/auth/signin/signin_templ.go b/view/client/auth/signin/signin_templ.go index 055767c..78a6113 100644 --- a/view/client/auth/signin/signin_templ.go +++ b/view/client/auth/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("

Login

") + 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("
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(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 continue with

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/auth/signup/signup_templ.go b/view/client/auth/signup/signup_templ.go index 155ee54..3fa02a6 100644 --- a/view/client/auth/signup/signup_templ.go +++ b/view/client/auth/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

") + 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("
Error! ") + 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 } } - _, 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
Or continue with

Already have an account? Log in

") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 4) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -146,7 +146,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, 5) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -193,7 +193,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, 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 0d9f69d..c5ecb4c 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 fb030d0..285256e 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/file/file_templ.go b/view/client/file/file_templ.go index e541613..01d959a 100644 --- a/view/client/file/file_templ.go +++ b/view/client/file/file_templ.go @@ -83,7 +83,7 @@ func MainContent(title string, files []types.FileData, user types.User, allowanc 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 } @@ -96,7 +96,7 @@ func MainContent(title string, files []types.FileData, user types.User, allowanc 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 } @@ -104,7 +104,7 @@ func MainContent(title string, files []types.FileData, user types.User, allowanc if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Back
File NameFile SizeDownloadsStatusAction
File Information Total Files: ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 13) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -202,7 +202,7 @@ func MainContent(title string, files []types.FileData, user types.User, allowanc if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" Total Usage: ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 14) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -215,7 +215,7 @@ func MainContent(title string, files []types.FileData, user types.User, allowanc if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" Total Allowance: ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 15) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -228,7 +228,7 @@ func MainContent(title string, files []types.FileData, user types.User, allowanc if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 16) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -314,7 +314,7 @@ func JustFile(file types.FileData) templ.Component { templ_7745c5c3_Var14 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, 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 } if !file.Done { - _, 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 } @@ -340,7 +340,7 @@ func JustFile(file types.FileData) 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, 21) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -366,12 +366,12 @@ func JustFile(file types.FileData) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Corrupted
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 22) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 23) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -379,7 +379,7 @@ func JustFile(file types.FileData) 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, 25) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -405,12 +405,12 @@ func JustFile(file types.FileData) 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, 26) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 27) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -423,7 +423,7 @@ func JustFile(file types.FileData) 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, 28) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -436,22 +436,22 @@ func JustFile(file types.FileData) 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, 29) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if file.IsPrivate { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Private
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 30) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Public
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 31) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 32) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -459,7 +459,7 @@ func JustFile(file types.FileData) 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, 49) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -631,32 +631,32 @@ func FileIcon(fileType string) templ.Component { } ctx = templ.ClearChildren(ctx) if fileType == "jpg" || fileType == "jpeg" || fileType == "png" || fileType == "gif" || fileType == "bmp" || fileType == "tiff" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("image-pictureCreated with Sketch Beta. ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 50) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else if fileType == "pdf" || fileType == "doc" || fileType == "docx" || fileType == "txt" || fileType == "odt" || fileType == "xls" || fileType == "xlsx" || fileType == "ppt" || fileType == "pptx" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 51) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else if fileType == "zip" || fileType == "rar" || fileType == "tar" || fileType == "gz" || fileType == "7z" || fileType == "bz2" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 52) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else if fileType == "exe" || fileType == "bin" || fileType == "sh" || fileType == "bat" || fileType == "cmd" || fileType == "msi" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 53) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else if fileType == "apk" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 54) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 55) 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 67c0c31..6875c4e 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 8af3413..b7c6a5f 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("
") + 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/totp/totp_templ.go b/view/client/totp/totp_templ.go index bc069fc..d1528be 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("

Two-Factor Authentication

Enter the 6-digit code from your authenticator app

") + 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 94ad502..a4c06c9 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 7e6de9e..5ba3b99 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 }