mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 17:51:44 +03:00
Verify that we have an identity only in read-write mode
This commit is contained in:
parent
43c78da02e
commit
dfdb5e090b
@ -20,6 +20,7 @@ import (
|
||||
|
||||
"github.com/MichaelMure/git-bug/graphql"
|
||||
"github.com/MichaelMure/git-bug/graphql/config"
|
||||
"github.com/MichaelMure/git-bug/identity"
|
||||
"github.com/MichaelMure/git-bug/repository"
|
||||
"github.com/MichaelMure/git-bug/util/git"
|
||||
"github.com/MichaelMure/git-bug/webui"
|
||||
@ -43,6 +44,13 @@ func runWebUI(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
if !webUIReadOnly {
|
||||
// Verify that we have an identity.
|
||||
if _, err := identity.GetUserIdentity(repo); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
addr := fmt.Sprintf("127.0.0.1:%d", webUIPort)
|
||||
webUiAddr := fmt.Sprintf("http://%s", addr)
|
||||
|
||||
@ -253,7 +261,7 @@ var webUICmd = &cobra.Command{
|
||||
Available git config:
|
||||
git-bug.webui.open [bool]: control the automatic opening of the web UI in the default browser
|
||||
`,
|
||||
PreRunE: loadRepoEnsureUser,
|
||||
PreRunE: loadRepo,
|
||||
RunE: runWebUI,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user