summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/oauth/token.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/oauth/token.go b/internal/oauth/token.go
index a3d0d3b..251b689 100644
--- a/internal/oauth/token.go
+++ b/internal/oauth/token.go
@@ -7,6 +7,7 @@ import (
"time"
"github.com/eduvpn/eduvpn-common/internal/log"
+ "github.com/eduvpn/eduvpn-common/types/server"
"github.com/go-errors/errors"
)
@@ -38,6 +39,14 @@ type Token struct {
ExpiredTimestamp time.Time
}
+func (t *Token) Public() server.Tokens {
+ return server.Tokens{
+ Access: t.Access,
+ Refresh: t.Refresh,
+ Expires: t.ExpiredTimestamp.Unix(),
+ }
+}
+
// tokenRefresher is a structure that contains our access and refresh tokens and a timestamp when they expire.
// Additionally, it contains the refresher to get new tokens
type tokenRefresher struct {