Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spike: proxy error on login [INS-4009] #7546

Merged
merged 6 commits into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/insomnia/src/ui/routes/auth.authorize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { invariant } from '../../utils/invariant';
import { SegmentEvent } from '../analytics';
import { getLoginUrl, submitAuthCode } from '../auth-session-provider';
import { Icon } from '../components/icon';
import { showSettingsModal } from '../components/modals/settings-modal';
import { Button } from '../components/themed-button';

export const action: ActionFunction = async ({
Expand All @@ -16,7 +17,7 @@ export const action: ActionFunction = async ({
invariant(typeof data?.code === 'string', 'Expected code to be a string');
const error = await submitAuthCode(data.code);
if (error) {
const humanReadableError = error?.message === 'TypeError: Failed to fetch' ? 'Network failed, try again.' : error?.message;
const humanReadableError = error?.message === 'Failed to fetch' ? 'Network failed, please try again. If the problem persists, check your network and proxy settings.' : error?.message;
return {
errors: {
message: humanReadableError,
Expand Down Expand Up @@ -152,6 +153,13 @@ const Authorize = () => {
<Icon icon="arrow-left" />
<span>Go Back</span>
</Button>
<Button
data-testid="settings-button-auth-authorize"
className="px-4 py-1 h-full flex items-center justify-center gap-2 aria-pressed:bg-[--hl-sm] text-[--color-font] text-xs hover:bg-[--hl-xs] focus:ring-inset ring-1 ring-transparent focus:ring-[--hl-md] transition-all"
onClick={showSettingsModal}
>
<Icon icon="gear" /> Preferences
</Button>
</div>
</div>
);
Expand Down
Loading