Skip to content

Commit

Permalink
fix: add generate otp provisioning uri endpoint (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos authored Jan 20, 2025
1 parent 8a7e9ba commit c42b7b3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/api/authFactor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export type CreateAuthFactorArg = CreateArg<AuthFactor, "type">
export type DestroyAuthFactorResult = DestroyResult
export type DestroyAuthFactorArg = DestroyArg<AuthFactor>

export type GenerateOtpProvisioningUriResult = string
export type GenerateOtpProvisioningUriArg = null

const authFactorApi = api.injectEndpoints({
endpoints: build => ({
...getReadAuthFactorEndpoints(build),
Expand All @@ -47,6 +50,15 @@ const authFactorApi = api.injectEndpoints({
}),
invalidatesTags: tagData(AUTH_FACTOR_TAG, { includeListTag: true }),
}),
generateOtpProvisioningUri: build.query<
GenerateOtpProvisioningUriResult,
GenerateOtpProvisioningUriArg
>({
query: () => ({
url: urls.authFactor.list + "generate-otp-provisioning-uri/",
method: "POST",
}),
}),
}),
})

Expand All @@ -56,4 +68,5 @@ export const {
useDestroyAuthFactorMutation,
useListAuthFactorsQuery,
useLazyListAuthFactorsQuery,
useGenerateOtpProvisioningUriQuery,
} = authFactorApi

0 comments on commit c42b7b3

Please sign in to comment.