mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +02:00
Use config from OAuth2Authenticator for auth command
This commit is contained in:
parent
cf3747bde2
commit
d0739aad0f
5 changed files with 31 additions and 18 deletions
|
@ -17,6 +17,7 @@ Scotty. If not, see <https://www.gnu.org/licenses/>.
|
|||
package models
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
|
@ -83,9 +84,11 @@ type LovesImport interface {
|
|||
|
||||
// Must be implemented by backends requiring OAuth2 authentication
|
||||
type OAuth2Authenticator interface {
|
||||
Backend
|
||||
|
||||
// Returns OAuth2 config suitable for this backend
|
||||
OAuth2Config(redirectUrl string) oauth2.Config
|
||||
OAuth2Config(redirectUrl *url.URL) oauth2.Config
|
||||
|
||||
// Setup the OAuth2 client
|
||||
OAuth2Setup(redirectUrl string, token *oauth2.Token) error
|
||||
OAuth2Setup(redirectUrl *url.URL, token *oauth2.Token) error
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue