···21212222var jwtExpirationDuration = 30 * time.Second
23232424-// Returned by [ClientApp.ProcessCallback] if the AS signals an error in the redirect URL parameters, per rfc6749 section 4.1.2.1
2525-//
2626-// NOTE: This is untrusted data and should not be e.g. rendered to HTML without appropriate escaping
2727-type CallbackError struct {
2828- code string
2929- description string
3030- uri *syntax.URI
3131-}
3232-3333-func (e *CallbackError) Error() string {
3434- res := "callbackError: " + e.code
3535- if e.description != "" {
3636- res += ": " + e.description
3737- }
3838- if e.uri != nil {
3939- res += " (" + e.uri.String() + ")"
4040- }
4141- return res
4242-}
4343-4424// Service-level client. Used to establish and refrsh OAuth sessions, but is not itself account or session specific, and can not be used directly to make API calls on behalf of a user.
4525type ClientApp struct {
4626 Client *http.Client
···622602 if err == nil {
623603 errorUri = &parsedUri
624604 }
625625- return nil, &CallbackError{
605605+ return nil, &ErrCallback{
626606 code: errorCode,
627607 description: params.Get("error_description"),
628608 uri: errorUri,
+20
atproto/auth/oauth/types.go
···407407 // Refresh token, for doing additional token requests to the auth server.
408408 RefreshToken string `json:"refresh_token"`
409409}
410410+411411+// Returned by [ClientApp.ProcessCallback] if the AS signals an error in the redirect URL parameters, per rfc6749 section 4.1.2.1
412412+//
413413+// NOTE: This is untrusted data and should not be e.g. rendered to HTML without appropriate escaping
414414+type ErrCallback struct {
415415+ code string
416416+ description string
417417+ uri *syntax.URI
418418+}
419419+420420+func (e *ErrCallback) Error() string {
421421+ res := "callbackError: " + e.code
422422+ if e.description != "" {
423423+ res += ": " + e.description
424424+ }
425425+ if e.uri != nil {
426426+ res += " (" + e.uri.String() + ")"
427427+ }
428428+ return res
429429+}