backup
This commit is contained in:
32
auth/auth.go
Normal file
32
auth/auth.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package SpotifyGoAuth
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
type SpotifyAuthenticator struct {
|
||||
config *oauth2.Config
|
||||
}
|
||||
|
||||
func CreateAuthenticator() (SpotifyAuthenticator, error) {
|
||||
oauth := oauth2.Config{
|
||||
ClientID: os.Getenv("SPOTIFY_ID"),
|
||||
ClientSecret: os.Getenv("SPOTIFY_SECRET"),
|
||||
Endpoint: oauth2.Endpoint{
|
||||
AuthURL: "https://accounts.spotify.com/authorize",
|
||||
TokenURL: "https://accounts.spotify.com/api/token",
|
||||
},
|
||||
}
|
||||
|
||||
authenticator := SpotifyAuthenticator{
|
||||
config: &oauth,
|
||||
}
|
||||
|
||||
return authenticator, nil
|
||||
}
|
||||
|
||||
func (auth SpotifyAuthenticator) generateAuthURL() (string, error) {
|
||||
|
||||
}
|
Reference in New Issue
Block a user