ayn2op/discordo

Login details aren't remembered when quitting and restarting

Closed this issue · 6 comments

Distro: NixOS

Every time restarting Discordo I'm prompted for login details, regardless of the 'Remember Me' checkbox being checked on last login.

Are there any logs / other info I could provide to clarify what's happening

I'd wager this is related to the token being stored via go-keyring. I haven't touched NixOS myself yet, but I found this unix.stackexchange post which talked about how to enable Gnome's keyring. Perhaps that helps?

Otherwise (and I know this is more of a workaround than a solution to the problem) there's always the option to log in via token, which you could store in pass or any other password manager.

Related to this, and given how there have been a few issues already regarding the keyring, perhaps 99designs/keyring is a good alternative to zalando/go-keyring, as it supports pass as a backend, in addition to all the standard keyrings.

Related to this, and given how there have been a few issues already regarding the keyring, perhaps 99designs/keyring is a good alternative to zalando/go-keyring, as it supports pass as a backend, in addition to all the standard keyrings.

99designs/keyring uses Cgo, while zalando/go-keyring does not.

99designs/keyring uses Cgo, while zalando/go-keyring does not.

I'm not a Go developer, so I might be understanding this wrong, but the only cgo-related code I see is this header in keychain.go:

// +build darwin,cgo

which was added to enable cross-compilation between Linux and Darwin:

commit 756c48deecbd97e8fe3581f20efbaa136689cf80
(...)

Add cgo build tag for crosscompiles
    
go-keychain is all cgo as of right now, so attempting to cross-compile a
darwin executable of aws-vault on linux results in errors about undefined
functions. If the cgo build tag is added here, linux cross-compiles of
darwin complete successfully (albeit without keychain functionality). I
am interested in this because I want transparent access across a host
macbook and multiple vagrant machines running on it with the .aws-vault
directory mapped into them, which seemed to work after I compiled
binaries including this change.

diff (...)
-// +build darwin
+// +build darwin,cgo

My understanding is that typically for Cgo, one would #include "somelib.h" (or any other relevant C code) and then make it available via `import "C".

Then again, maybe I'm looking in the wrong place. Is the library worth a second look?

99designs/keyring uses Cgo, while zalando/go-keyring does not.

I'm not a Go developer, so I might be understanding this wrong, but the only cgo-related code I see is this header in keychain.go:

// +build darwin,cgo

which was added to enable cross-compilation between Linux and Darwin:

commit 756c48deecbd97e8fe3581f20efbaa136689cf80
(...)

Add cgo build tag for crosscompiles
    
go-keychain is all cgo as of right now, so attempting to cross-compile a
darwin executable of aws-vault on linux results in errors about undefined
functions. If the cgo build tag is added here, linux cross-compiles of
darwin complete successfully (albeit without keychain functionality). I
am interested in this because I want transparent access across a host
macbook and multiple vagrant machines running on it with the .aws-vault
directory mapped into them, which seemed to work after I compiled
binaries including this change.

diff (...)
-// +build darwin
+// +build darwin,cgo

My understanding is that typically for Cgo, one would #include "somelib.h" (or any other relevant C code) and then make it available via `import "C".

Then again, maybe I'm looking in the wrong place. Is the library worth a second look?

99designs/keyring depends on 99designs/go-keychain which uses uses cgo to use macOS-specific API