feat: allow to use specific open account
This commit is contained in:
parent
c8ad9a0410
commit
ad4df95c0d
1 changed files with 7 additions and 0 deletions
7
auth.go
7
auth.go
|
|
@ -357,6 +357,13 @@ func (s *Scraper) LoginOpenAccount() (OpenAccount, error) {
|
||||||
return OpenAccount{}, fmt.Errorf("auth error: %v", "OpenAccount")
|
return OpenAccount{}, fmt.Errorf("auth error: %v", "OpenAccount")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Scraper) WithOpenAccount(openAccount OpenAccount) {
|
||||||
|
s.oAuthToken = openAccount.OAuthToken
|
||||||
|
s.oAuthSecret = openAccount.OAuthTokenSecret
|
||||||
|
s.isLogged = true
|
||||||
|
s.isOpenAccount = true
|
||||||
|
}
|
||||||
|
|
||||||
// Logout is reset session
|
// Logout is reset session
|
||||||
func (s *Scraper) Logout() error {
|
func (s *Scraper) Logout() error {
|
||||||
req, err := http.NewRequest("POST", logoutURL, nil)
|
req, err := http.NewRequest("POST", logoutURL, nil)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue