Skip to content

Commit

Permalink
signin functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
schwarzlichtbezirk committed Nov 19, 2024
1 parent 78ea1c7 commit 93c963d
Show file tree
Hide file tree
Showing 10 changed files with 151 additions and 111 deletions.
36 changes: 35 additions & 1 deletion api/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func ReqSignIs(email string) (user User, err error) {
Email: email,
}
var ret RetSignIs
ret, _, err = HttpPost[ArgSignIs, RetSignIs]("/user/is", Admin.Access, &arg)
ret, _, err = HttpPost[ArgSignIs, RetSignIs]("/signin", Admin.Access, &arg)
user.UID = ret.UID
user.Email = ret.Email
user.Name = ret.Name
Expand All @@ -64,6 +64,40 @@ func ReqRefresh() (ret AuthResp, err error) {
return
}

type (
useritem struct {
XMLName xml.Name `json:"-" yaml:"-" xml:"user"`
UID uint64 `json:"uid,omitempty" yaml:"uid,omitempty" xml:"uid,attr,omitempty"`
Email string `json:"email,omitempty" yaml:"email,omitempty" xml:"email,attr,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty" xml:"name,attr,omitempty"`
}
ArgUserIs struct {
XMLName xml.Name `json:"-" yaml:"-" xml:"arg"`
List []useritem `json:"list" yaml:"list" xml:"list>user"`
}
RetUserIs struct {
XMLName xml.Name `json:"-" yaml:"-" xml:"ret"`
List []useritem `json:"list" yaml:"list" xml:"list>user"`
}
)

func ReqUserIs(emails []string) (users []User, err error) {
var arg ArgUserIs
var ret RetUserIs
arg.List = make([]useritem, len(emails))
for i, email := range emails {
arg.List[i].Email = email
}
ret, _, err = HttpPost[ArgUserIs, RetUserIs]("/user/is", Admin.Access, &arg)
users = make([]User, len(ret.List))
for i, item := range ret.List {
users[i].UID = item.UID
users[i].Email = item.Email
users[i].Name = item.Name
}
return
}

type (
clubitem struct {
XMLName xml.Name `json:"-" yaml:"-" xml:"club"`
Expand Down
6 changes: 3 additions & 3 deletions api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import (
cfg "github.com/slotopol/balance/config"
)

type ajaxerr struct {
type AjaxErr struct {
What string `json:"what" yaml:"what" xml:"what"`
Code int `json:"code,omitempty" yaml:"code,omitempty" xml:"code,omitempty"`
UID uint64 `json:"uid,omitempty" yaml:"uid,omitempty" xml:"uid,omitempty,attr"`
}

func (err ajaxerr) Error() string {
func (err AjaxErr) Error() string {
return fmt.Sprintf("what: %s, code: %d", err.What, err.Code)
}

Expand Down Expand Up @@ -54,7 +54,7 @@ func HttpPost[Ta, Tr any](path string, token string, arg *Ta) (ret Tr, status in
return
}
if resp.StatusCode >= http.StatusBadRequest {
var aerr ajaxerr
var aerr AjaxErr
if err = json.Unmarshal(b, &aerr); err != nil {
return
}
Expand Down
93 changes: 56 additions & 37 deletions config/cfgpath.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package cfg

import (
"errors"
"log"
"os"
"path/filepath"

"github.com/spf13/viper"
"gopkg.in/yaml.v3"
)

const AppID = "slotopol.balance"

const (
cfgcredentials = "balance-credentials.yaml"
cfguserlist = "balance-userlist.yaml"
cfgcredentials = "credentials.yaml"
cfguserlist = "userlist.yaml"
)

var (
// Executable path.
ExePath string
// Configuration file with path.
CfgFile string
// Configuration path.
CfgPath string
)
Expand All @@ -35,59 +35,78 @@ func init() {
}
}()

// Config path
const sub = "config"
// Search config in home directory with name "balance" (without extension).
viper.SetConfigName("balance-app")
viper.SetConfigType("yaml")
if env, ok := os.LookupEnv("CFGFILE"); ok {
viper.AddConfigPath(env)
// Configuration path
var oscfgpath string
if oscfgpath, err = os.UserConfigDir(); err != nil {
log.Printf("can not obtain user config directory, any settings can not be saved: %s", err.Error())
return
}
viper.AddConfigPath(filepath.Join(ExePath, sub))
viper.AddConfigPath(ExePath)
viper.AddConfigPath(sub)
viper.AddConfigPath(".")
if home, err := os.UserHomeDir(); err == nil {
viper.AddConfigPath(filepath.Join(home, sub))
viper.AddConfigPath(home)
CfgPath = filepath.Join(oscfgpath, "fyne", AppID)
log.Printf("config path: %s\n", CfgPath)

if err = ReadCredentials(); err != nil {
log.Printf("failure on reading credentials, using default: %s\n", err.Error())
}
if env, ok := os.LookupEnv("GOBIN"); ok {
viper.AddConfigPath(filepath.Join(env, sub))
viper.AddConfigPath(env)
} else if env, ok := os.LookupEnv("GOPATH"); ok {
viper.AddConfigPath(filepath.Join(env, "bin", sub))
viper.AddConfigPath(filepath.Join(env, "bin"))
if err = ReadUserList(); err != nil {
log.Printf("failure on reading userlist, using default: %s\n", err.Error())
}
}

viper.AutomaticEnv()
var (
ErrNoCfgPath = errors.New("configuration path does not obtained")
)

if err = viper.ReadInConfig(); err != nil {
log.Println("config file not found!")
} else {
viper.Unmarshal(&Cfg)
CfgFile = viper.ConfigFileUsed()
CfgPath = filepath.Dir(CfgFile)
log.Printf("config path: %s\n", CfgPath)
func ReadCredentials() (err error) {
if CfgPath == "" {
return ErrNoCfgPath
}
var b []byte
if b, err = os.ReadFile(filepath.Join(CfgPath, cfgcredentials)); err != nil {
return
}
if err = yaml.Unmarshal(b, Credentials); err != nil {
return
}
return
}

func ReadCredentials() (err error) {
func SaveCredentials() (err error) {
if CfgPath == "" {
return ErrNoCfgPath
}
var b []byte
if b, err = os.ReadFile(filepath.Join(CfgPath, cfgcredentials)); err != nil {
if b, err = yaml.Marshal(Credentials); err != nil {
return
}
if yaml.Unmarshal(b, Credentials); err != nil {
if err = os.WriteFile(filepath.Join(CfgPath, cfgcredentials), b, 0666); err != nil {
return
}
return
}

func ReadUserList() (err error) {
if CfgPath == "" {
return ErrNoCfgPath
}
var b []byte
if b, err = os.ReadFile(filepath.Join(CfgPath, cfguserlist)); err != nil {
return
}
if yaml.Unmarshal(b, &UserList); err != nil {
if err = yaml.Unmarshal(b, &UserList); err != nil {
return
}
return
}

func SaveUserList() (err error) {
if CfgPath == "" {
return ErrNoCfgPath
}
var b []byte
if b, err = yaml.Marshal(&UserList); err != nil {
return
}
if err = os.WriteFile(filepath.Join(CfgPath, cfguserlist), b, 0666); err != nil {
return
}
return
Expand Down
12 changes: 0 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.23

require (
fyne.io/fyne/v2 v2.5.2
github.com/spf13/viper v1.8.1
golang.org/x/image v0.18.0
gopkg.in/yaml.v3 v3.0.1
)
Expand All @@ -24,28 +23,17 @@ require (
github.com/go-text/typesetting v0.2.0 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jeandeaual/go-locale v0.0.0-20240223122105-ce5225dcaa49 // indirect
github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/nicksnyder/go-i18n/v2 v2.4.0 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rymdport/portal v0.2.6 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c // indirect
github.com/srwiley/rasterx v0.0.0-20220730225603-2ab79fcdd4ef // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/yuin/goldmark v1.7.1 // indirect
golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.16.0 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
14 changes: 0 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
Expand All @@ -205,7 +204,6 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e h1:LvL4XsI70QxOGHed6yhQtAU34Kx3Qq2wwBzGFKY8zKk=
github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e/go.mod h1:kLgvv7o6UM+0QSf0QjAse3wReFDsb9qbZJdfexWlrQw=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
Expand All @@ -214,7 +212,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
Expand All @@ -226,7 +223,6 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag=
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
Expand All @@ -238,7 +234,6 @@ github.com/nicksnyder/go-i18n/v2 v2.4.0/go.mod h1:nxYSZE9M0bf3Y70gPQjN9ha7XNHX7g
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA=
Expand All @@ -259,20 +254,13 @@ github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636/go.mod h1:TDJrrUr11Vxr
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk=
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44=
github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c h1:km8GpoQut05eY3GiYWEedbTT0qnSxrCjsVbb7yKY1KE=
github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c/go.mod h1:cNQ3dwVJtS5Hmnjxy6AgTPd0Inb3pW05ftPSX7NZO7Q=
Expand All @@ -288,7 +276,6 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down Expand Up @@ -647,7 +634,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU=
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package main
import (
"fyne.io/fyne/v2/app"

cfg "github.com/slotopol/balance/config"
"github.com/slotopol/balance/ui"
)

func main() {
var a = app.NewWithID("slotopol.balance")
var a = app.NewWithID(cfg.AppID)
ui.Lifecycle(a)
var frame = &ui.Frame{}
frame.CreateWindow(a)
Expand Down
2 changes: 1 addition & 1 deletion task/build-win-x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This script compiles project for Windows amd64.

wd=$(realpath -s "$(dirname "$0")/..")
cp -ruv "$wd/confdata/"* "$GOPATH/bin/config"
cp -ruv "$wd/appdata/"* "$HOME/AppData/Roaming/fyne/slotopol.balance"

go env -w GOOS=windows GOARCH=amd64 CGO_ENABLED=1
go build -o "$GOPATH/bin/balance_win_x64.exe" -v -tags="" $wd
1 change: 1 addition & 0 deletions ui/frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func (p *SigninPage) Create() {
{Text: "Email", Widget: p.email, HintText: "A valid registered email address"},
{Text: "Secret", Widget: p.secret, HintText: "Password for authorization"},
},
SubmitText: "Sign-in",
}

p.signinPage = container.NewStack(
Expand Down
7 changes: 0 additions & 7 deletions ui/res.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import (

// icons
var (
//go:embed icon/login.svg
loginRes []byte

//go:embed icon/logout.svg
logoutRes []byte

Expand Down Expand Up @@ -95,10 +92,6 @@ var (

// icon resources
var (
loginIconRes = theme.NewThemedResource(&fyne.StaticResource{
StaticName: "login",
StaticContent: loginRes,
})
logoutIconRes = theme.NewThemedResource(&fyne.StaticResource{
StaticName: "logout",
StaticContent: logoutRes,
Expand Down
Loading

0 comments on commit 93c963d

Please sign in to comment.