mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 13:47:05 +02:00
Autenticate OAuth backends
This commit is contained in:
parent
94704f9cd0
commit
fa7732c538
15 changed files with 61 additions and 20 deletions
|
@ -24,7 +24,6 @@ package storage
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
@ -95,11 +94,10 @@ func (db Database) GetOAuth2Token(service string) (*oauth2.Token, error) {
|
|||
if result.Token != nil {
|
||||
err = json.Unmarshal(result.Token, &token)
|
||||
}
|
||||
fmt.Printf("TOK DEC: %v\n", token)
|
||||
return &token, err
|
||||
}
|
||||
|
||||
func (db Database) SetOAuth2Token(service string, token oauth2.Token) error {
|
||||
func (db Database) SetOAuth2Token(service string, token *oauth2.Token) error {
|
||||
jsonTok, err := json.Marshal(token)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue