mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 00:29:34 +00:00
feat(infisical-pg): completed signup, login, password and backup key migration
This commit is contained in:
@@ -72,9 +72,9 @@ export const ServerConfigProvider = ({ children }: Props): JSX.Element => {
|
||||
|
||||
export const useServerConfig = () => {
|
||||
const ctx = useContext(ServerConfigContext);
|
||||
if (!ctx) {
|
||||
throw new Error("useServerConfig has to be used within <UserContext.Provider>");
|
||||
}
|
||||
// if (!ctx) {
|
||||
// throw new Error("useServerConfig has to be used within <UserContext.Provider>");
|
||||
// }
|
||||
|
||||
return ctx;
|
||||
return ctx || { config: { allowSignUp: true } };
|
||||
};
|
||||
|
||||
@@ -121,7 +121,7 @@ export const verifySignupInvite = async (details: VerifySignupInviteDTO) => {
|
||||
export const useSendVerificationEmail = () => {
|
||||
return useMutation({
|
||||
mutationFn: async ({ email }: { email: string }) => {
|
||||
const { data } = await apiRequest.post("/api/v1/signup/email/signup", {
|
||||
const { data } = await apiRequest.post("/api/v3/signup/email/signup", {
|
||||
email
|
||||
});
|
||||
|
||||
@@ -133,7 +133,7 @@ export const useSendVerificationEmail = () => {
|
||||
export const useVerifyEmailVerificationCode = () => {
|
||||
return useMutation({
|
||||
mutationFn: async ({ email, code }: { email: string; code: string }) => {
|
||||
const { data } = await apiRequest.post("/api/v1/signup/email/verify", {
|
||||
const { data } = await apiRequest.post("/api/v3/signup/email/verify", {
|
||||
email,
|
||||
code
|
||||
});
|
||||
|
||||
@@ -82,14 +82,13 @@ const App = ({ Component, pageProps, ...appProps }: NextAppProp): JSX.Element =>
|
||||
publicPaths.includes(`/${appProps.router.pathname.split("/")[1]}`) ||
|
||||
!Component.requireAuth
|
||||
) {
|
||||
// TODO(akhilmhdh): bring back server config later
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<NotificationProvider>
|
||||
<ServerConfigProvider>
|
||||
<AuthProvider>
|
||||
<Component {...pageProps} />
|
||||
</AuthProvider>
|
||||
</ServerConfigProvider>
|
||||
<AuthProvider>
|
||||
<Component {...pageProps} />
|
||||
</AuthProvider>
|
||||
</NotificationProvider>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user