(auth *Auth)
| 104 | } |
| 105 | |
| 106 | func authHasOAuthMetadata(auth *Auth) bool { |
| 107 | if auth == nil || len(auth.Metadata) == 0 { |
| 108 | return false |
| 109 | } |
| 110 | for _, key := range []string{"access_token", "refresh_token", "id_token", "email", "token_type", "expires_at", "expired"} { |
| 111 | if authMetadataString(auth, key) != "" { |
| 112 | return true |
| 113 | } |
| 114 | } |
| 115 | if token, ok := auth.Metadata["token"].(map[string]any); ok && len(token) > 0 { |
| 116 | return true |
| 117 | } |
| 118 | return false |
| 119 | } |
| 120 | |
| 121 | func authAttribute(auth *Auth, key string) string { |
| 122 | if auth == nil || auth.Attributes == nil { |
no test coverage detected