mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-20 14:17:29 -04:00
[INS-1473] fix credentials not reloading in Git form (#9470)
* fix: ensure credentials are returned as an object for GitHub and GitLab loaders * chore: update padding tailwind class in project create form checkbox * fix: prevent default behavior on sign out button click for GitHub and GitLab forms
This commit is contained in:
@@ -8,7 +8,9 @@ import type { Route } from './+types/git-credentials.github';
|
||||
export async function clientLoader(_args: Route.ClientActionArgs) {
|
||||
const credentials = await gitCredentials.getByProvider('github');
|
||||
|
||||
return credentials;
|
||||
return {
|
||||
credentials,
|
||||
};
|
||||
}
|
||||
|
||||
export const useGitHubCredentialsFetcher = createFetcherLoadHook(
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { Route } from './+types/git-credentials.gitlab';
|
||||
export async function clientLoader(_args: Route.ClientActionArgs) {
|
||||
const credentials = await gitCredentials.getByProvider('gitlab');
|
||||
|
||||
return credentials;
|
||||
return { credentials };
|
||||
}
|
||||
|
||||
export const useGitLabCredentialsFetcher = createFetcherLoadHook(
|
||||
|
||||
@@ -28,7 +28,7 @@ export const GitHubRepositorySetupFormGroup = (props: Props) => {
|
||||
}
|
||||
}, [githubTokenLoader]);
|
||||
|
||||
const credentials = githubTokenLoader.data;
|
||||
const credentials = githubTokenLoader.data?.credentials;
|
||||
|
||||
if (!credentials?.token) {
|
||||
return <GitHubSignInForm />;
|
||||
@@ -123,7 +123,8 @@ const GitHubRepositoryForm = ({
|
||||
</div>
|
||||
<PromptButton
|
||||
confirmMessage="Confirm"
|
||||
onClick={() => {
|
||||
onClick={e => {
|
||||
e.preventDefault();
|
||||
signOutFetcher.submit();
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -27,7 +27,7 @@ export const GitLabRepositorySetupFormGroup = (props: Props) => {
|
||||
}
|
||||
}, [gitlabTokenLoader]);
|
||||
|
||||
const credentials = gitlabTokenLoader.data;
|
||||
const credentials = gitlabTokenLoader.data?.credentials;
|
||||
|
||||
if (!credentials?.token) {
|
||||
return <GitLabSignInForm />;
|
||||
@@ -105,7 +105,8 @@ const GitLabRepositoryForm = ({ uri, credentials, onSubmit }: GitLabRepositoryFo
|
||||
</div>
|
||||
</div>
|
||||
<PromptButton
|
||||
onClick={() => {
|
||||
onClick={e => {
|
||||
e.preventDefault();
|
||||
signOutFetcher.submit();
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -141,7 +141,7 @@ export const ProjectCreateForm: FC<Props> = ({
|
||||
slot={null}
|
||||
isSelected={projectData.connectRepositoryLater}
|
||||
onChange={isSelected => setProjectData(prev => ({ ...prev, connectRepositoryLater: isSelected }))}
|
||||
className="group mt-4 flex h-full items-center gap-2 p-0 pl-[1px]"
|
||||
className="group mt-4 flex h-full items-center gap-2 p-0 pl-px"
|
||||
>
|
||||
<div className="flex h-4 w-4 items-center justify-center rounded-sm ring-1 ring-(--hl-sm) transition-colors group-focus:ring-2 group-data-selected:bg-(--hl-xs)">
|
||||
<Icon
|
||||
|
||||
Reference in New Issue
Block a user