mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-08 21:37:58 -05:00
Merge pull request #15 from phuonganhniie/master
chore: validate spotify client_id and client_secret before initialize…
This commit is contained in:
@@ -53,6 +53,12 @@ type payload struct {
|
||||
}
|
||||
|
||||
func InitClient() error {
|
||||
clientID := os.Getenv("SPOTIFY_ID")
|
||||
clientSecret := os.Getenv("SPOTIFY_SECRET")
|
||||
if clientID == "" || clientSecret == "" {
|
||||
return errors.New("SPOTIFY_ID and/or SPOTIFY_SECRET are missing. Please make sure you have set the SPOTIFY_ID and SPOTIFY_SECRET environment variables")
|
||||
}
|
||||
|
||||
token := &oauth2.Token{}
|
||||
|
||||
// shouldn't be nil if the file doesn't exist.
|
||||
|
||||
Reference in New Issue
Block a user