-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
126 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,23 +60,31 @@ func main() { | |
email := "[email protected]" | ||
password := "PLEASE_DON'T_PLAINTEXT_REAL_PASSWORDS" | ||
|
||
// returns account object with: email, password, uuid | ||
account := blink.NewAccount(email, password) | ||
// returns account object with: email, password, uuid | ||
// this is required for login and once authenticated, used | ||
// for any blink operations | ||
account := blink.NewAccount(user, pass) | ||
|
||
// this returns a login response that you can use | ||
// however, it is unneccessary for this example | ||
if _, err := account.Login(); err != nil { | ||
loginResp, err := account.Login() | ||
|
||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
fmt.Print("Enter Pin: ") | ||
var pin string | ||
fmt.Scanln(&pin) | ||
|
||
// this returns a verify pin response that you can use | ||
// however, it is unneccessary for this example | ||
if _, err = account.VerifyPin(pin); err != nil { | ||
log.Fatal(err) | ||
// if blink wants a 2FA verification you must use the | ||
// verify pin operation | ||
// 2FA is not always required but typically required first | ||
// time on new device | ||
if loginResp.Account.AccountVerificationRequired { | ||
fmt.Print("Enter Pin: ") | ||
var pin string | ||
fmt.Scanln(&pin) | ||
|
||
// this returns a verify pin response that you can use | ||
// however, it is unneccessary for this example | ||
if _, err := account.VerifyPin(pin); err != nil { | ||
log.Fatal(err) | ||
} | ||
} | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
package blink | ||
|
||
func (account *Account) GetSyncModules() error { | ||
// Returns sync modules from manifest | ||
func (account *Account) GetSyncModules() (*[]SyncModule, error) { | ||
manifest, err := account.GetManifest() | ||
|
||
if err != nil { | ||
return err | ||
return nil, err | ||
} | ||
|
||
account.SyncModules = &manifest.SyncModules | ||
return nil | ||
return &manifest.SyncModules, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.