aboutsummaryrefslogtreecommitdiff
path: root/backend/auth
diff options
context:
space:
mode:
authorGuillermo Serrahima <dev@vylion.com>2026-04-07 08:36:13 +0200
committerGuillermo Serrahima <dev@vylion.com>2026-04-07 08:46:41 +0200
commit1a31555761bb5180ed496d61511f6a36d791cb78 (patch)
treecc14aa03002734feb9e6c59a3ee02ab652b1764d /backend/auth
parent2bd2e1fd4fcf147ff4bb229226d879b6b6b5fa78 (diff)
downloadllostre-1a31555761bb5180ed496d61511f6a36d791cb78.tar.xz
llostre-1a31555761bb5180ed496d61511f6a36d791cb78.zip
reworked cache with redis + improved fetching
Diffstat (limited to 'backend/auth')
-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)