feat(infisical-pg): completed signup, login, password and backup key migration

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:22 +05:30
parent 05205d1eff
commit fcfd6b3fb2
68 changed files with 7529 additions and 58 deletions
@@ -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 } };
};
+2 -2
View File
@@ -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
});
+4 -5
View File
@@ -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>
);