aboutsummaryrefslogtreecommitdiff
path: root/backend/auth/oauth.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/auth/oauth.go')
-rw-r--r--backend/auth/oauth.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/backend/auth/oauth.go b/backend/auth/oauth.go
index 9be1da0..a1b0419 100644
--- a/backend/auth/oauth.go
+++ b/backend/auth/oauth.go
@@ -44,6 +44,18 @@ type TokenResponse struct {
ExpiresIn int `json:"expires_in"`
}
+func (s *OAuthState) Copy() *OAuthState {
+ return &OAuthState{
+ State: s.State,
+ DID: s.DID,
+ PDS: s.PDS,
+ AccessToken: s.AccessToken,
+ RefreshToken: s.RefreshToken,
+ ExpiresAt: s.ExpiresAt,
+ KeyPair: s.KeyPair,
+ }
+}
+
func GenerateRandomToken() (string, error) {
b := make([]byte, 32)
_, err := rand.Read(b)