Work with go-jose to have encryption

This commit is contained in:
Bolke de Bruin 2020-08-19 11:33:26 +02:00
parent 2822dc8dd1
commit 188f077da1
7 changed files with 131 additions and 55 deletions

View file

@ -2,6 +2,7 @@ package common
import (
"context"
"log"
"net"
"net/http"
"strings"
@ -48,3 +49,12 @@ func GetClientIp(ctx context.Context) string {
}
return s
}
func GetAccessToken(ctx context.Context) string {
token, ok := ctx.Value("access_token").(string)
if !ok {
log.Printf("cannot get access token from context")
return ""
}
return token
}