format
This commit is contained in:
parent
65e55c3823
commit
d332273355
8 changed files with 21 additions and 29 deletions
|
@ -534,7 +534,7 @@ export function useMcp(options: UseMcpOptions): UseMcpResult {
|
|||
metadataRef.current = await discoverOAuthMetadata(url)
|
||||
addLog('debug', `OAuth metadata: ${metadataRef.current ? 'Found' : 'Not available'}`)
|
||||
}
|
||||
|
||||
|
||||
// If metadata is found, start auth flow
|
||||
if (metadataRef.current) {
|
||||
setState('authenticating')
|
||||
|
@ -599,7 +599,7 @@ export function useMcp(options: UseMcpOptions): UseMcpResult {
|
|||
}
|
||||
} catch (connectErr) {
|
||||
addLog('error', `Client connect error: ${connectErr instanceof Error ? connectErr.message : String(connectErr)}`)
|
||||
|
||||
|
||||
if (connectErr instanceof Error && connectErr.message.includes('Unauthorized')) {
|
||||
// Only discover OAuth and authenticate if we get a 401
|
||||
await discoverOAuthAndAuthenticate(connectErr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue