@@ -6,8 +6,9 @@ import BearerAuth from './BearerAuth';
6
6
import BasicAuth from './BasicAuth' ;
7
7
import DigestAuth from './DigestAuth' ;
8
8
import StyledWrapper from './StyledWrapper' ;
9
- import { humanizeRequestAuthMode } from 'utils/collections/index ' ;
9
+ import { humanizeRequestAuthMode } from 'utils/collections' ;
10
10
import OAuth2 from './OAuth2/index' ;
11
+ import CredentialsPreview from './OAuth2/CredentialsPreview' ;
11
12
12
13
const Auth = ( { item, collection } ) => {
13
14
const authMode = item . draft ? get ( item , 'draft.request.auth.mode' ) : get ( item , 'request.auth.mode' ) ;
@@ -34,22 +35,13 @@ const Auth = ({ item, collection }) => {
34
35
}
35
36
case 'inherit' : {
36
37
return (
37
- < div className = "flex flex-row w-full mt-2 gap-2" >
38
- { collectionAuth ?. mode === 'oauth2' ? (
39
- < div className = "flex flex-col gap-2" >
40
- < div className = "flex flex-row gap-1" >
41
- < div > Collection level auth is: </ div >
42
- < div className = "inherit-mode-text" > { humanizeRequestAuthMode ( collectionAuth ?. mode ) } </ div >
43
- </ div >
44
- < div className = "text-sm opacity-50" > Cannot inherit Oauth2 from collection.</ div >
45
- </ div >
46
- ) : (
47
- < >
48
- < div > Auth inherited from the Collection: </ div >
49
- < div className = "inherit-mode-text" > { humanizeRequestAuthMode ( collectionAuth ?. mode ) } </ div >
50
- </ >
51
- ) }
52
- </ div >
38
+ < >
39
+ < div className = "flex flex-row w-full mt-2 gap-2" >
40
+ < div > Auth inherited from the Collection: </ div >
41
+ < div className = "inherit-mode-text" > { humanizeRequestAuthMode ( collectionAuth ?. mode ) } </ div >
42
+ </ div >
43
+ { collectionAuth ?. mode === 'oauth2' && < CredentialsPreview item = { item } collection = { collection } /> }
44
+ </ >
53
45
) ;
54
46
}
55
47
}
0 commit comments