mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2026-03-27 22:46:37 +00:00
Work with go-jose to have encryption
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user