@carlonicora/nextjs-jsonapi 1.31.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BlockNoteEditor-CUIQPN6C.mjs → BlockNoteEditor-TFL6ZXIJ.mjs} +4 -4
- package/dist/{BlockNoteEditor-NBASFIQP.js → BlockNoteEditor-YEVSJSOI.js} +14 -14
- package/dist/{BlockNoteEditor-NBASFIQP.js.map → BlockNoteEditor-YEVSJSOI.js.map} +1 -1
- package/dist/billing/index.js +335 -335
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-ITBPDMUX.js → chunk-HIF7DYR3.js} +537 -482
- package/dist/chunk-HIF7DYR3.js.map +1 -0
- package/dist/{chunk-C62JXXUX.mjs → chunk-IXVNXOZT.mjs} +8 -1
- package/dist/{chunk-C62JXXUX.mjs.map → chunk-IXVNXOZT.mjs.map} +1 -1
- package/dist/{chunk-HBCIT6KE.js → chunk-KYG2PIRB.js} +5 -1
- package/dist/chunk-KYG2PIRB.js.map +1 -0
- package/dist/{chunk-OR5NPUWF.js → chunk-NPNKFWV2.js} +9 -2
- package/dist/chunk-NPNKFWV2.js.map +1 -0
- package/dist/{chunk-TM4RWVZE.mjs → chunk-SLANIL6B.mjs} +455 -400
- package/dist/chunk-SLANIL6B.mjs.map +1 -0
- package/dist/{chunk-RACFENTQ.mjs → chunk-YCP2OMFD.mjs} +5 -1
- package/dist/chunk-YCP2OMFD.mjs.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/{s3.service-D7NyMnNY.d.ts → s3.service-CoC0k0iu.d.ts} +3 -0
- package/dist/{s3.service-D2vIfl9y.d.mts → s3.service-Duh9HW2n.d.mts} +3 -0
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/package.json +1 -1
- package/src/features/auth/components/buttons/GoogleSignInButton.tsx +41 -0
- package/src/features/auth/components/details/LandingComponent.tsx +3 -1
- package/src/features/auth/components/forms/Login.tsx +3 -1
- package/src/features/auth/data/auth.interface.ts +3 -0
- package/src/features/auth/data/auth.service.ts +1 -0
- package/src/features/auth/data/auth.ts +3 -0
- package/src/login/config.ts +7 -0
- package/src/login/index.ts +7 -1
- package/dist/chunk-HBCIT6KE.js.map +0 -1
- package/dist/chunk-ITBPDMUX.js.map +0 -1
- package/dist/chunk-OR5NPUWF.js.map +0 -1
- package/dist/chunk-RACFENTQ.mjs.map +0 -1
- package/dist/chunk-TM4RWVZE.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-CUIQPN6C.mjs.map → BlockNoteEditor-TFL6ZXIJ.mjs.map} +0 -0
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
import { useTranslations } from "next-intl";
|
|
4
4
|
import Image from "next/image";
|
|
5
5
|
import { getApiUrl } from "../../../../client/config";
|
|
6
|
-
import { isDiscordAuthEnabled, isInternalAuthEnabled, isRegistrationAllowed } from "../../../../login";
|
|
6
|
+
import { isDiscordAuthEnabled, isGoogleAuthEnabled, isInternalAuthEnabled, isRegistrationAllowed } from "../../../../login";
|
|
7
7
|
import { Button, CardDescription, CardFooter, CardHeader, CardTitle, Link } from "../../../../shadcnui";
|
|
8
8
|
import { useAuthContext } from "../../contexts";
|
|
9
9
|
import { AuthComponent } from "../../enums";
|
|
10
|
+
import { GoogleSignInButton } from "../buttons/GoogleSignInButton";
|
|
10
11
|
|
|
11
12
|
export function LandingComponent() {
|
|
12
13
|
const t = useTranslations();
|
|
@@ -45,6 +46,7 @@ export function LandingComponent() {
|
|
|
45
46
|
</Link>
|
|
46
47
|
</>
|
|
47
48
|
)}
|
|
49
|
+
{isGoogleAuthEnabled() && <GoogleSignInButton />}
|
|
48
50
|
{isDiscordAuthEnabled() && (
|
|
49
51
|
<Link href={`${getApiUrl()}auth/discord`} className="flex w-full justify-end">
|
|
50
52
|
<Button className="w-full" variant={`outline`} data-testid="page-login-button-initial-login">
|
|
@@ -8,7 +8,7 @@ import { z } from "zod";
|
|
|
8
8
|
import { getApiUrl } from "../../../../client/config";
|
|
9
9
|
import { errorToast, FormInput, FormPassword } from "../../../../components";
|
|
10
10
|
import { useI18nRouter, usePageUrlGenerator } from "../../../../hooks";
|
|
11
|
-
import { isDiscordAuthEnabled, isInternalAuthEnabled } from "../../../../login";
|
|
11
|
+
import { isDiscordAuthEnabled, isGoogleAuthEnabled, isInternalAuthEnabled } from "../../../../login";
|
|
12
12
|
import {
|
|
13
13
|
Button,
|
|
14
14
|
CardContent,
|
|
@@ -24,6 +24,7 @@ import { useCurrentUserContext } from "../../../user/contexts";
|
|
|
24
24
|
import { useAuthContext } from "../../contexts";
|
|
25
25
|
import { AuthService } from "../../data/auth.service";
|
|
26
26
|
import { AuthComponent } from "../../enums";
|
|
27
|
+
import { GoogleSignInButton } from "../buttons/GoogleSignInButton";
|
|
27
28
|
|
|
28
29
|
export function Login() {
|
|
29
30
|
const t = useTranslations();
|
|
@@ -101,6 +102,7 @@ export function Login() {
|
|
|
101
102
|
)}
|
|
102
103
|
</CardContent>
|
|
103
104
|
<CardFooter className="flex w-full flex-col gap-y-4 mt-4">
|
|
105
|
+
{isGoogleAuthEnabled() && <GoogleSignInButton />}
|
|
104
106
|
{isDiscordAuthEnabled() && (
|
|
105
107
|
<Link href={`${getApiUrl()}auth/discord`} className="flex w-full justify-end">
|
|
106
108
|
<Button className="w-full" variant={`outline`} data-testid="page-login-button-initial-login">
|
|
@@ -46,6 +46,9 @@ export class Auth extends AbstractApiData implements AuthInterface {
|
|
|
46
46
|
if (data.name !== undefined) response.data.attributes.name = data.name;
|
|
47
47
|
if (data.companyName !== undefined) response.data.attributes.companyName = data.companyName;
|
|
48
48
|
if (data.password !== undefined) response.data.attributes.password = data.password;
|
|
49
|
+
if (data.termsAcceptedAt !== undefined) response.data.attributes.termsAcceptedAt = data.termsAcceptedAt;
|
|
50
|
+
if (data.marketingConsent !== undefined) response.data.attributes.marketingConsent = data.marketingConsent;
|
|
51
|
+
if (data.marketingConsentAt !== undefined) response.data.attributes.marketingConsentAt = data.marketingConsentAt;
|
|
49
52
|
|
|
50
53
|
return response;
|
|
51
54
|
}
|
package/src/login/config.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
let _useDiscordAuth: boolean = false;
|
|
2
|
+
let _useGoogleAuth: boolean = false;
|
|
2
3
|
let _useInternalAuth: boolean = true;
|
|
3
4
|
let _allowRegistration: boolean = true;
|
|
4
5
|
|
|
5
6
|
export interface LoginConfig {
|
|
6
7
|
useDiscordAuth: boolean;
|
|
8
|
+
useGoogleAuth: boolean;
|
|
7
9
|
useInternalAuth: boolean;
|
|
8
10
|
allowRegistration?: boolean;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export function configureLogin(params: LoginConfig): void {
|
|
12
14
|
_useDiscordAuth = params.useDiscordAuth;
|
|
15
|
+
_useGoogleAuth = params.useGoogleAuth;
|
|
13
16
|
_useInternalAuth = params.useInternalAuth;
|
|
14
17
|
_allowRegistration = params.allowRegistration ?? true;
|
|
15
18
|
}
|
|
@@ -18,6 +21,10 @@ export function isDiscordAuthEnabled(): boolean {
|
|
|
18
21
|
return _useDiscordAuth;
|
|
19
22
|
}
|
|
20
23
|
|
|
24
|
+
export function isGoogleAuthEnabled(): boolean {
|
|
25
|
+
return _useGoogleAuth;
|
|
26
|
+
}
|
|
27
|
+
|
|
21
28
|
export function isInternalAuthEnabled(): boolean {
|
|
22
29
|
return _useInternalAuth;
|
|
23
30
|
}
|
package/src/login/index.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {
|
|
2
|
+
configureLogin,
|
|
3
|
+
isDiscordAuthEnabled,
|
|
4
|
+
isGoogleAuthEnabled,
|
|
5
|
+
isInternalAuthEnabled,
|
|
6
|
+
isRegistrationAllowed,
|
|
7
|
+
} from "./config";
|
|
2
8
|
export type { LoginConfig } from "./config";
|