diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/index.js index 7280e67290..aff1cc1734 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/index.js @@ -13,6 +13,8 @@ const AuthMode = ({ collection }) => { const onDropdownCreate = (ref) => (dropdownTippyRef.current = ref); const authMode = get(collection, 'root.request.auth.mode'); + const authModes = ['awsv4', 'basic', 'bearer', 'digest', 'oauth2', 'none']; + const Icon = forwardRef((props, ref) => { return (
@@ -34,60 +36,21 @@ const AuthMode = ({ collection }) => {
} placement="bottom-end"> -
{ - dropdownTippyRef.current.hide(); - onModeChange('awsv4'); - }} - > - AWS Sig v4 -
-
{ - dropdownTippyRef.current.hide(); - onModeChange('basic'); - }} - > - Basic Auth -
-
{ - dropdownTippyRef.current.hide(); - onModeChange('bearer'); - }} - > - Bearer Token -
-
{ - dropdownTippyRef.current.hide(); - onModeChange('digest'); - }} - > - Digest Auth -
-
{ - dropdownTippyRef.current.hide(); - onModeChange('oauth2'); - }} - > - Oauth2 -
-
{ - dropdownTippyRef.current.hide(); - onModeChange('none'); - }} - > - No Auth -
+ {authModes.map((mode) => { + return ( + <> +
{ + dropdownTippyRef.current.hide(); + onModeChange(mode); + }} + > + {humanizeRequestAuthMode(mode)} +
+ + ); + })}
diff --git a/packages/bruno-app/src/components/RequestPane/Auth/AuthMode/index.js b/packages/bruno-app/src/components/RequestPane/Auth/AuthMode/index.js index 2367d96452..c12ceffe88 100644 --- a/packages/bruno-app/src/components/RequestPane/Auth/AuthMode/index.js +++ b/packages/bruno-app/src/components/RequestPane/Auth/AuthMode/index.js @@ -13,6 +13,8 @@ const AuthMode = ({ item, collection }) => { const onDropdownCreate = (ref) => (dropdownTippyRef.current = ref); const authMode = item.draft ? get(item, 'draft.request.auth.mode') : get(item, 'request.auth.mode'); + const authModes = ['awsv4', 'basic', 'bearer', 'digest', 'oauth2', 'inherit', 'none']; + const Icon = forwardRef((props, ref) => { return (
@@ -35,69 +37,21 @@ const AuthMode = ({ item, collection }) => {
} placement="bottom-end"> -
{ - dropdownTippyRef?.current?.hide(); - onModeChange('awsv4'); - }} - > - AWS Sig v4 -
-
{ - dropdownTippyRef?.current?.hide(); - onModeChange('basic'); - }} - > - Basic Auth -
-
{ - dropdownTippyRef?.current?.hide(); - onModeChange('bearer'); - }} - > - Bearer Token -
-
{ - dropdownTippyRef?.current?.hide(); - onModeChange('digest'); - }} - > - Digest Auth -
-
{ - dropdownTippyRef?.current?.hide(); - onModeChange('oauth2'); - }} - > - OAuth 2.0 -
-
{ - dropdownTippyRef?.current?.hide(); - onModeChange('inherit'); - }} - > - Inherit -
-
{ - dropdownTippyRef?.current?.hide(); - onModeChange('none'); - }} - > - No Auth -
+ {authModes.map((mode) => { + return ( + <> +
{ + dropdownTippyRef?.current?.hide(); + onModeChange(mode); + }} + > + {humanizeRequestAuthMode(mode)} +
+ + ); + })}