From 1a31555761bb5180ed496d61511f6a36d791cb78 Mon Sep 17 00:00:00 2001 From: Guillermo Serrahima Date: Tue, 7 Apr 2026 08:36:13 +0200 Subject: reworked cache with redis + improved fetching --- backend/auth/oauth.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'backend/auth/oauth.go') 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) -- cgit v1.2.3