Skip to content
Snippets Groups Projects
Commit 9cf80eab authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Auth confirmations working

parent 88632513
No related branches found
No related tags found
3 merge requests!510Release,!207WIP: Client Restructure,!203Symmetric broadcast
...@@ -162,6 +162,8 @@ EnretBzQkeKeBwoB2u6NTiOmUjk= ...@@ -162,6 +162,8 @@ EnretBzQkeKeBwoB2u6NTiOmUjk=
testNetCert = `` testNetCert = ``
) )
var authCbs *authCallbacks
// Execute adds all child commands to the root command and sets flags // Execute adds all child commands to the root command and sets flags
// appropriately. This is called by main.main(). It only needs to // appropriately. This is called by main.main(). It only needs to
// happen once to the rootCmd. // happen once to the rootCmd.
...@@ -288,6 +290,15 @@ var rootCmd = &cobra.Command{ ...@@ -288,6 +290,15 @@ var rootCmd = &cobra.Command{
authConfirmed = false authConfirmed = false
} }
go func() {
for {
authID := <-authCbs.confCh
if authID.Cmp(recipientID) {
authConfirmed = true
}
}
}()
if !unsafe && !authConfirmed { if !unsafe && !authConfirmed {
jww.INFO.Printf("Waiting for authentication channel"+ jww.INFO.Printf("Waiting for authentication channel"+
" confirmation with partner %s", recipientID) " confirmation with partner %s", recipientID)
...@@ -597,7 +608,7 @@ func initClient() *api.Client { ...@@ -597,7 +608,7 @@ func initClient() *api.Client {
params := initParams() params := initParams()
// load the client // load the client
authCbs := makeAuthCallbacks(nil, authCbs = makeAuthCallbacks(nil,
viper.GetBool("unsafe-channel-creation")) viper.GetBool("unsafe-channel-creation"))
client, err := api.Login(storeDir, pass, authCbs, params) client, err := api.Login(storeDir, pass, authCbs, params)
authCbs.client = client authCbs.client = client
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment