Improved auth and logging

This commit is contained in:
2017-06-15 15:50:39 +02:00
parent a6a3609ab7
commit c858a58123
7 changed files with 73 additions and 39 deletions

30
auth.go Normal file
View File

@ -0,0 +1,30 @@
package main
import (
"encoding/json"
"io/ioutil"
)
// APIKeys ...
type APIKeys struct {
Google struct {
ID string `json:"id"`
Secret string `json:"secret"`
} `json:"google"`
Facebook struct {
ID string `json:"id"`
Secret string `json:"secret"`
} `json:"facebook"`
}
var apiKeys APIKeys
func init() {
data, _ := ioutil.ReadFile("security/api-keys.json")
err := json.Unmarshal(data, &apiKeys)
if err != nil {
panic(err)
}
}