Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Mar 19, 2024
1 parent 7b03bc7 commit 809b397
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 20 deletions.
Expand Up @@ -338,7 +338,7 @@ onMounted(() => {
const auth = unsavedCollectionProperties.collection?.auth
if (auth?.authType === "oauth-2") {
const grantTypeInfo = auth?.grantTypeInfo
const grantTypeInfo = auth.grantTypeInfo
grantTypeInfo && (grantTypeInfo.token = token ?? "")
}
Expand Down
Expand Up @@ -373,7 +373,7 @@ onMounted(() => {
const auth = unsavedCollectionProperties.collection?.auth as HoppRESTAuth
if (auth?.authType === "oauth-2") {
const grantTypeInfo = auth?.grantTypeInfo
const grantTypeInfo = auth.grantTypeInfo
grantTypeInfo && (grantTypeInfo.token = token ?? "")
}
Expand Down
Expand Up @@ -259,7 +259,6 @@ const props = withDefaults(
const emit = defineEmits<{
(e: "update:modelValue", value: HoppRESTAuth): void
(e: "generateOAuthToken"): void
}>()
const auth = useVModel(props, "modelValue", emit)
Expand Down
Expand Up @@ -158,7 +158,7 @@
hide()
}
"
></HoppSmartItem>
/>
</div>
</template>
</tippy>
Expand Down Expand Up @@ -206,10 +206,7 @@ import passwordFlow, {
PasswordFlowParams,
getDefaultPasswordFlowParams,
} from "~/services/oauth/flows/password"
import {
PersistedOAuthConfig,
grantTypesInvolvingRedirect,
} from "~/services/oauth/oauth.service"
import { PersistedOAuthConfig } from "~/services/oauth/oauth.service"
import { PersistenceService } from "~/services/persistence"
import { GQLTabService } from "~/services/tab/graphql"
import { RESTTabService } from "~/services/tab/rest"
Expand All @@ -230,22 +227,16 @@ const props = defineProps<{
source: "REST" | "GraphQL"
}>()
const emit = defineEmits<{
(e: "generateOAuthToken"): void
}>()
const auth = ref(props.modelValue)
const addToTargets = [
{
id: "HEADERS" as const,
label: "Headers",
value: "Headers",
},
{
id: "QUERY_PARAMS" as const,
label: "Query Params",
value: "Query Params",
},
]
Expand Down Expand Up @@ -541,7 +532,7 @@ const supportedGrantTypes = [
return E.left("OAUTH_TOKEN_FETCH_FAILED" as const)
}
setAccessTokenInActiveTab(res.right?.access_token)
setAccessTokenInActiveContext(res.right?.access_token)
toast.success(t("authorization.oauth.token_fetched_successfully"))
Expand Down Expand Up @@ -686,7 +677,7 @@ const supportedGrantTypes = [
return E.left("OAUTH_TOKEN_FETCH_FAILED" as const)
}
setAccessTokenInActiveTab(res.right?.access_token)
setAccessTokenInActiveContext(res.right?.access_token)
toast.success(t("authorization.oauth.token_fetched_successfully"))
Expand Down Expand Up @@ -860,7 +851,7 @@ const selectedGrantType = computed(() => {
)
})
const setAccessTokenInActiveTab = (accessToken?: string) => {
const setAccessTokenInActiveContext = (accessToken?: string) => {
if (props.isCollectionProperty && accessToken) {
auth.value.grantTypeInfo = {
...auth.value.grantTypeInfo,
Expand Down
2 changes: 0 additions & 2 deletions packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts
Expand Up @@ -359,8 +359,6 @@ export function getEffectiveRESTRequest(
}))
)

console.log(`Final params are `, effectiveFinalParams)

const effectiveFinalRequestVariables = pipe(
request.requestVariables,
A.filter((x) => x.active && x.key !== ""),
Expand Down
Expand Up @@ -150,7 +150,7 @@ export const GQL_HISTORY_MOCK: GQLHistoryEntry[] = [
{
v: 1,
request: {
v: 2,
v: 3,
name: "Untitled",
url: "https://echo.hoppscotch.io/graphql",
query: "query Request { url }",
Expand Down

0 comments on commit 809b397

Please sign in to comment.