This commit is contained in:
2026-02-28 16:24:37 +00:00
parent 0ac43946b1
commit bf1685a382
7 changed files with 23 additions and 8 deletions

View File

@@ -9,10 +9,21 @@ import (
"path/filepath"
"github.com/BurntSushi/toml"
"math/rand/v2"
_ "embed"
)
func randomClientResource() string {
chars := "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZλ"
str := ""
for range 4 {
str = str + string(chars[rand.IntN(len(chars))])
}
return "lambda." + str
}
func dropToSignInPage(err error) {
app := gtk.NewApplication("net.sunglocto.lambda.login", gio.ApplicationFlagsNone)
app.ConnectActivate(func() {
@@ -81,6 +92,7 @@ func dropToSignInPage(err error) {
conf.Nick = nickname_entry.Text()
conf.Insecure = insecure_check.Active()
conf.JoinBookmarks = true
conf.Resource = randomClientResource()
var b bytes.Buffer
e := toml.NewEncoder(&b)