Merge pull request #489 from rwese/fix-login-form-autofill
Fix login form password-manager support
This commit is contained in:
commit
0d18b421e1
|
|
@ -26,7 +26,7 @@ jobs:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: golangci/golangci-lint-action@v2
|
- uses: golangci/golangci-lint-action@v2
|
||||||
with:
|
with:
|
||||||
version: v1.31
|
version: v1.45
|
||||||
args: --timeout=5m
|
args: --timeout=5m
|
||||||
- run: go mod download
|
- run: go mod download
|
||||||
- run: make download-tools
|
- run: make download-tools
|
||||||
|
|
|
||||||
|
|
@ -9,18 +9,15 @@ linters:
|
||||||
- deadcode
|
- deadcode
|
||||||
- depguard
|
- depguard
|
||||||
- exportloopref
|
- exportloopref
|
||||||
- gci
|
|
||||||
- godot
|
- godot
|
||||||
- gofmt
|
- gofmt
|
||||||
- gofumpt
|
- gofumpt
|
||||||
- goimports
|
- goimports
|
||||||
- golint
|
|
||||||
- gomodguard
|
- gomodguard
|
||||||
- goprintffuncname
|
- goprintffuncname
|
||||||
- gosimple
|
- gosimple
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- interfacer
|
|
||||||
- misspell
|
- misspell
|
||||||
- nakedret
|
- nakedret
|
||||||
- nolintlint
|
- nolintlint
|
||||||
|
|
|
||||||
4
app.go
4
app.go
|
|
@ -34,11 +34,11 @@ func main() {
|
||||||
conf := config.Get()
|
conf := config.Get()
|
||||||
|
|
||||||
if conf.PluginsDir != "" {
|
if conf.PluginsDir != "" {
|
||||||
if err := os.MkdirAll(conf.PluginsDir, 0755); err != nil {
|
if err := os.MkdirAll(conf.PluginsDir, 0o755); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := os.MkdirAll(conf.UploadedImagesDir, 0755); err != nil {
|
if err := os.MkdirAll(conf.UploadedImagesDir, 0o755); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !race
|
||||||
// +build !race
|
// +build !race
|
||||||
|
|
||||||
package auth
|
package auth
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !race
|
||||||
// +build !race
|
// +build !race
|
||||||
|
|
||||||
package password
|
package password
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,9 @@ import (
|
||||||
"github.com/gotify/server/v2/auth/password"
|
"github.com/gotify/server/v2/auth/password"
|
||||||
"github.com/gotify/server/v2/model"
|
"github.com/gotify/server/v2/model"
|
||||||
"github.com/jinzhu/gorm"
|
"github.com/jinzhu/gorm"
|
||||||
|
_ "github.com/jinzhu/gorm/dialects/mysql" // enable the mysql dialect.
|
||||||
// enable the mysql dialect.
|
_ "github.com/jinzhu/gorm/dialects/postgres" // enable the postgres dialect.
|
||||||
_ "github.com/jinzhu/gorm/dialects/mysql"
|
_ "github.com/jinzhu/gorm/dialects/sqlite" // enable the sqlite3 dialect.
|
||||||
|
|
||||||
// enable the postgres dialect.
|
|
||||||
_ "github.com/jinzhu/gorm/dialects/postgres"
|
|
||||||
|
|
||||||
// enable the sqlite3 dialect.
|
|
||||||
_ "github.com/jinzhu/gorm/dialects/sqlite"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var mkdirAll = os.MkdirAll
|
var mkdirAll = os.MkdirAll
|
||||||
|
|
@ -95,7 +89,7 @@ func prepareBlobColumn(dialect string, db *gorm.DB) error {
|
||||||
func createDirectoryIfSqlite(dialect, connection string) {
|
func createDirectoryIfSqlite(dialect, connection string) {
|
||||||
if dialect == "sqlite3" {
|
if dialect == "sqlite3" {
|
||||||
if _, err := os.Stat(filepath.Dir(connection)); os.IsNotExist(err) {
|
if _, err := os.Stat(filepath.Dir(connection)); os.IsNotExist(err) {
|
||||||
if err := mkdirAll(filepath.Dir(connection), 0777); err != nil {
|
if err := mkdirAll(filepath.Dir(connection), 0o777); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build linux || darwin
|
||||||
// +build linux darwin
|
// +build linux darwin
|
||||||
|
|
||||||
package compat
|
package compat
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !race
|
||||||
// +build !race
|
// +build !race
|
||||||
|
|
||||||
package compat
|
package compat
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build (linux || darwin) && !race
|
||||||
// +build linux darwin
|
// +build linux darwin
|
||||||
// +build !race
|
// +build !race
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !race
|
||||||
// +build !race
|
// +build !race
|
||||||
|
|
||||||
package plugin
|
package plugin
|
||||||
|
|
|
||||||
|
|
@ -31,13 +31,13 @@ func TestWithWd(t *testing.T) {
|
||||||
WithWd("non_exist", func(string) {})
|
WithWd("non_exist", func(string) {})
|
||||||
})
|
})
|
||||||
|
|
||||||
assert.Nil(t, os.Mkdir(tmpDir.Path(), 0644))
|
assert.Nil(t, os.Mkdir(tmpDir.Path(), 0o644))
|
||||||
assert.Panics(t, func() {
|
assert.Panics(t, func() {
|
||||||
WithWd(tmpDir.Path(), func(string) {})
|
WithWd(tmpDir.Path(), func(string) {})
|
||||||
})
|
})
|
||||||
assert.Nil(t, os.Remove(tmpDir.Path()))
|
assert.Nil(t, os.Remove(tmpDir.Path()))
|
||||||
|
|
||||||
assert.Nil(t, os.Mkdir(tmpDir.Path(), 0755))
|
assert.Nil(t, os.Mkdir(tmpDir.Path(), 0o755))
|
||||||
assert.Panics(t, func() {
|
assert.Panics(t, func() {
|
||||||
WithWd(tmpDir.Path(), func(string) {
|
WithWd(tmpDir.Path(), func(string) {
|
||||||
assert.Nil(t, os.RemoveAll(tmpDir.Path()))
|
assert.Nil(t, os.RemoveAll(tmpDir.Path()))
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ class Login extends Component<Stores<'currentUser'>> {
|
||||||
className="name"
|
className="name"
|
||||||
label="Username"
|
label="Username"
|
||||||
margin="dense"
|
margin="dense"
|
||||||
|
autoComplete="username"
|
||||||
value={username}
|
value={username}
|
||||||
onChange={(e) => (this.username = e.target.value)}
|
onChange={(e) => (this.username = e.target.value)}
|
||||||
/>
|
/>
|
||||||
|
|
@ -39,6 +40,7 @@ class Login extends Component<Stores<'currentUser'>> {
|
||||||
className="password"
|
className="password"
|
||||||
label="Password"
|
label="Password"
|
||||||
margin="normal"
|
margin="normal"
|
||||||
|
autoComplete="current-password"
|
||||||
value={password}
|
value={password}
|
||||||
onChange={(e) => (this.password = e.target.value)}
|
onChange={(e) => (this.password = e.target.value)}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue