adding jwt tokens
This commit is contained in:
@@ -16,7 +16,7 @@ type SQLConfig struct {
|
||||
Port string
|
||||
}
|
||||
|
||||
func connectToPostgreSQL(config SQLConfig) (*gorm.DB, error) {
|
||||
func connectToPostgreSQL(config *SQLConfig) (*gorm.DB, error) {
|
||||
dsn := fmt.Sprintf(
|
||||
"user=%s password=%s dbname=%s host=%s port=%s sslmode=disable",
|
||||
config.User, config.Password, config.DBName, config.Host, config.Port,
|
||||
@@ -43,7 +43,7 @@ func migrateDatabase(db *gorm.DB) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func InitDatabase(config SQLConfig) (*gorm.DB, error) {
|
||||
func InitDatabase(config *SQLConfig) (*gorm.DB, error) {
|
||||
db, err := connectToPostgreSQL(config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -70,7 +70,7 @@ func LoadSpotifyToken(path string) (*oauth2.Token, error) {
|
||||
return tok, nil
|
||||
}
|
||||
|
||||
func InitSpotifyAuth(config SpotifyConfig) (*spotifyauth.Authenticator, *spotify.Client) {
|
||||
func InitSpotifyAuth(config *SpotifyConfig) (*spotifyauth.Authenticator, *spotify.Client) {
|
||||
auth := spotifyauth.New(
|
||||
spotifyauth.WithRedirectURL(config.RedirectURL),
|
||||
spotifyauth.WithClientID(config.ClientID),
|
||||
|
||||
Reference in New Issue
Block a user