A container registry that uses the AT Protocol for manifest storage and S3 for blob storage. atcr.io
docker container atproto go

try and persist session tokens

evan.jarrett.net 4667d34b 4d5182e2

verified
+18
+18
pkg/auth/oauth/refresher.go
··· 134 134 return nil, fmt.Errorf("failed to resume session: %w", err) 135 135 } 136 136 137 + // Set up callback to persist token updates to SQLite 138 + // This ensures that when indigo automatically refreshes tokens, 139 + // the new tokens are saved to the database immediately 140 + session.PersistSessionCallback = func(callbackCtx context.Context, updatedData *oauth.ClientSessionData) { 141 + if err := r.app.GetClientApp().Store.SaveSession(callbackCtx, *updatedData); err != nil { 142 + slog.Error("Failed to persist OAuth session update", 143 + "component", "oauth/refresher", 144 + "did", did, 145 + "sessionID", sessionID, 146 + "error", err) 147 + } else { 148 + slog.Debug("Persisted OAuth token refresh to database", 149 + "component", "oauth/refresher", 150 + "did", did, 151 + "sessionID", sessionID) 152 + } 153 + } 154 + 137 155 // Cache the session 138 156 r.mu.Lock() 139 157 r.sessions[did] = &SessionCache{