@monocloud/auth-nextjs 0.1.5 → 0.1.7

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.
@@ -1,20 +1,17 @@
1
- const require_chunk = require('../chunk-CbDLau6x.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_chunk = require('../chunk-C0xms8kb.cjs');
2
3
  let react = require("react");
3
4
  react = require_chunk.__toESM(react);
4
5
 
5
6
  //#region src/components/signin.tsx
6
7
  /**
7
- * A component that renders an anchor tag configured to initiate the sign-in flow.
8
+ * `<SignIn>` renders a link that initiates the MonoCloud sign-in flow.
8
9
  *
9
- * @param props - Properties for the SignIn component.
10
- *
11
- * @returns An anchor element that links to the sign-in endpoint with the specified parameters.
12
- *
13
- * @example App Router and Pages Router
10
+ * It can be used in both **App Router** and **Pages Router**, and may be rendered from either **Server** or **Client Components**.
14
11
  *
15
- * **Sign-in component works on both the server and the client in pages router and app router.**
12
+ * @example Basic Usage
16
13
  *
17
- * ```tsx
14
+ * ```tsx title="Basic Usage"
18
15
  * import { SignIn } from "@monocloud/auth-nextjs/components";
19
16
  *
20
17
  * export default function Home() {
@@ -24,21 +21,24 @@ react = require_chunk.__toESM(react);
24
21
  *
25
22
  * @example Customize the authorization request
26
23
  *
27
- * You can customize the authorization request by passing in props. See {@link SignInProps}.
24
+ * You can customize the authorization request by passing props:
28
25
  *
29
- * **Note⚠️: You need to set the env `MONOCLOUD_AUTH_ALLOW_QUERY_PARAM_OVERRIDES=true` or `allowQueryParamOverrides` should be `true` in the client initialization for props to work**
30
- *
31
- * ```tsx
26
+ * ```tsx title="Customize the authorization request"
32
27
  * import { SignIn } from "@monocloud/auth-nextjs/components";
33
28
  *
34
29
  * export default function Home() {
35
30
  * return (
36
- * <SignIn loginHint="username" authenticatorHint="password">
31
+ * <SignIn loginHint="user@example.com" authenticatorHint="password" returnUrl="/dashboard">
37
32
  * Sign In
38
33
  * </SignIn>
39
34
  * );
40
35
  * }
41
36
  * ```
37
+ *
38
+ * @param props - Properties for the SignIn component.
39
+ * @returns An anchor element that links to the sign-in endpoint with the specified parameters.
40
+ *
41
+ * @category Components
42
42
  */
43
43
  const SignIn = ({ children, authenticatorHint, loginHint, prompt, display, uiLocales, scopes, acrValues, resource, maxAge, returnUrl, ...props }) => {
44
44
  const signInUrl = process.env.NEXT_PUBLIC_MONOCLOUD_AUTH_SIGNIN_URL ?? `${process.env.__NEXT_ROUTER_BASEPATH ?? ""}/api/auth/signin`;
@@ -62,18 +62,15 @@ const SignIn = ({ children, authenticatorHint, loginHint, prompt, display, uiLoc
62
62
  //#endregion
63
63
  //#region src/components/signup.tsx
64
64
  /**
65
- * A component that renders an anchor tag configured to initiate the sign-up flow.
66
- * * It functions similarly to the SignIn component but explicitly sets the `prompt` parameter to `create`.
67
- *
68
- * @param props - Properties for the SignUp component.
65
+ * `<SignUp>` renders a link that initiates the MonoCloud sign-up flow.
69
66
  *
70
- * @returns An anchor element that links to the sign-in endpoint with the prompt set to 'create'.
67
+ * It works in both **App Router** and **Pages Router**, and may be rendered from either **Server** or **Client Components**.
71
68
  *
72
- * @example App Router and Pages Router
69
+ * Internally, it behaves like `<SignIn>` but sets `prompt=create` to start the registration flow.
73
70
  *
74
- * **Sign-up component works on both the server and the client in pages router and app router.**
71
+ * @example Basic usage
75
72
  *
76
- * ```tsx
73
+ * ```tsx title="Basic Usage"
77
74
  * import { SignUp } from "@monocloud/auth-nextjs/components";
78
75
  *
79
76
  * export default function Home() {
@@ -83,17 +80,27 @@ const SignIn = ({ children, authenticatorHint, loginHint, prompt, display, uiLoc
83
80
  *
84
81
  * @example Customize the authorization request
85
82
  *
86
- * You can customize the authorization request by passing in props. See {@link SignUpProps}.
83
+ * You can customize the authorization request by passing in props.
87
84
  *
88
- * **Note⚠️: You need to set the env `MONOCLOUD_AUTH_ALLOW_QUERY_PARAM_OVERRIDES=true` or `allowQueryParamOverrides` should be `true` in the client initialization for props to work**
89
- *
90
- * ```tsx
85
+ * ```tsx title="Customize the authorization request"
91
86
  * import { SignUp } from "@monocloud/auth-nextjs/components";
92
87
  *
93
88
  * export default function Home() {
94
- * return <SignUp returnUrl="/dashboard">Sign Up</SignUp>;
89
+ * return (
90
+ * <SignUp
91
+ * returnUrl="/dashboard"
92
+ * uiLocales="en"
93
+ * >
94
+ * Sign Up
95
+ * </SignUp>
96
+ * );
95
97
  * }
96
98
  * ```
99
+ *
100
+ * @param props - Properties for the SignUp component.
101
+ * @returns An anchor element that links to the sign-in endpoint with the prompt set to 'create'.
102
+ *
103
+ * @category Components
97
104
  */
98
105
  const SignUp = ({ children, returnUrl, acrValues, display, maxAge, resource, scopes, uiLocales, ...props }) => {
99
106
  const signInUrl = process.env.NEXT_PUBLIC_MONOCLOUD_AUTH_SIGNIN_URL ?? `${process.env.__NEXT_ROUTER_BASEPATH ?? ""}/api/auth/signin`;
@@ -116,17 +123,13 @@ const SignUp = ({ children, returnUrl, acrValues, display, maxAge, resource, sco
116
123
  //#endregion
117
124
  //#region src/components/signout.tsx
118
125
  /**
119
- * A component that renders an anchor tag configured to initiate the sign-out flow.
120
- *
121
- * @param props - Properties for the SignOut component.
122
- *
123
- * @returns An anchor element that links to the sign-out endpoint.
126
+ * `<SignOut>` renders a link that initiates the MonoCloud sign-out flow.
124
127
  *
125
- * @example App Router and Pages Router
128
+ * It can be used in both **App Router** and **Pages Router**, and may be rendered from either **Server** or **Client Components**.
126
129
  *
127
- * **Sign-out component works on both the server and the client in pages router and app router.**
130
+ * @example Basic usage
128
131
  *
129
- * ```tsx
132
+ * ```tsx title="Basic Usage"
130
133
  * import { SignOut } from "@monocloud/auth-nextjs/components";
131
134
  *
132
135
  * export default function Home() {
@@ -134,19 +137,20 @@ const SignUp = ({ children, returnUrl, acrValues, display, maxAge, resource, sco
134
137
  * }
135
138
  * ```
136
139
  *
137
- * @example Customize the request
138
- *
139
- * You can customize the request by passing in props. See {@link SignOutProps}.
140
+ * @example Customize the sign-out request
140
141
  *
141
- * **Note⚠️: You need to set the env `MONOCLOUD_AUTH_ALLOW_QUERY_PARAM_OVERRIDES=true` or `allowQueryParamOverrides` should be `true` in the client initialization for props to work**
142
- *
143
- * ```tsx
142
+ * ```tsx title="Customize the sign-out request"
144
143
  * import { SignOut } from "@monocloud/auth-nextjs/components";
145
144
  *
146
145
  * export default function Home() {
147
- * return <SignOut federated={true}>Sign Out</SignOut>;
146
+ * return <SignOut federated postLogoutUrl="/goodbye">Sign Out</SignOut>;
148
147
  * }
149
148
  * ```
149
+ *
150
+ * @param props - Properties for the SignOut component.
151
+ * @returns An anchor element that links to the sign-out endpoint.
152
+ *
153
+ * @category Components
150
154
  */
151
155
  const SignOut = ({ children, postLogoutUrl, federated, ...props }) => {
152
156
  const signOutUrl = process.env.NEXT_PUBLIC_MONOCLOUD_AUTH_SIGNOUT_URL ?? `${process.env.__NEXT_ROUTER_BASEPATH ?? ""}/api/auth/signout`;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/components/signin.tsx","../../src/components/signup.tsx","../../src/components/signout.tsx"],"sourcesContent":["import React, { JSX } from 'react';\nimport { ExtraAuthParams } from '../types';\n\nexport interface SignInProps extends ExtraAuthParams {\n children: React.ReactNode;\n /**\n * URL to redirect to after a successful sign-in.\n */\n returnUrl?: string;\n}\n\n/**\n * A component that renders an anchor tag configured to initiate the sign-in flow.\n *\n * @param props - Properties for the SignIn component.\n *\n * @returns An anchor element that links to the sign-in endpoint with the specified parameters.\n *\n * @example App Router and Pages Router\n *\n * **Sign-in component works on both the server and the client in pages router and app router.**\n *\n * ```tsx\n * import { SignIn } from \"@monocloud/auth-nextjs/components\";\n *\n * export default function Home() {\n * return <SignIn>Sign In</SignIn>;\n * }\n * ```\n *\n * @example Customize the authorization request\n *\n * You can customize the authorization request by passing in props. See {@link SignInProps}.\n *\n * **Note⚠️: You need to set the env `MONOCLOUD_AUTH_ALLOW_QUERY_PARAM_OVERRIDES=true` or `allowQueryParamOverrides` should be `true` in the client initialization for props to work**\n *\n * ```tsx\n * import { SignIn } from \"@monocloud/auth-nextjs/components\";\n *\n * export default function Home() {\n * return (\n * <SignIn loginHint=\"username\" authenticatorHint=\"password\">\n * Sign In\n * </SignIn>\n * );\n * }\n * ```\n */\nexport const SignIn = ({\n children,\n authenticatorHint,\n loginHint,\n prompt,\n display,\n uiLocales,\n scopes,\n acrValues,\n resource,\n maxAge,\n returnUrl,\n ...props\n}: SignInProps &\n Omit<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n 'resource'\n >): JSX.Element => {\n const signInUrl =\n process.env.NEXT_PUBLIC_MONOCLOUD_AUTH_SIGNIN_URL ??\n // eslint-disable-next-line no-underscore-dangle\n `${process.env.__NEXT_ROUTER_BASEPATH ?? ''}/api/auth/signin`;\n\n const query = new URLSearchParams();\n\n if (authenticatorHint) {\n query.set('authenticator_hint', authenticatorHint);\n }\n\n if (prompt) {\n query.set('prompt', prompt);\n }\n\n if (display) {\n query.set('display', display);\n }\n\n if (uiLocales) {\n query.set('ui_locales', uiLocales);\n }\n\n if (scopes) {\n query.set('scope', scopes);\n }\n\n if (acrValues) {\n query.set('acr_values', acrValues.join(' '));\n }\n\n if (resource) {\n query.set('resource', resource);\n }\n\n if (maxAge) {\n query.set('max_age', maxAge.toString());\n }\n\n if (loginHint) {\n query.set('login_hint', loginHint);\n }\n\n if (returnUrl) {\n query.set('return_url', returnUrl);\n }\n\n return (\n <a\n href={`${signInUrl}${query.size ? `?${query.toString()}` : ''}`}\n {...props}\n >\n {children}\n </a>\n );\n};\n","import React, { JSX } from 'react';\nimport { ExtraAuthParams } from '../types';\n\nexport interface SignUpProps extends Omit<\n ExtraAuthParams,\n 'authenticatorHint' | 'loginHint' | 'prompt'\n> {\n /**\n * URL to redirect to after a successful sign-up.\n */\n returnUrl?: string;\n}\n\n/**\n * A component that renders an anchor tag configured to initiate the sign-up flow.\n * * It functions similarly to the SignIn component but explicitly sets the `prompt` parameter to `create`.\n *\n * @param props - Properties for the SignUp component.\n *\n * @returns An anchor element that links to the sign-in endpoint with the prompt set to 'create'.\n *\n * @example App Router and Pages Router\n *\n * **Sign-up component works on both the server and the client in pages router and app router.**\n *\n * ```tsx\n * import { SignUp } from \"@monocloud/auth-nextjs/components\";\n *\n * export default function Home() {\n * return <SignUp>Sign Up</SignUp>;\n * }\n * ```\n *\n * @example Customize the authorization request\n *\n * You can customize the authorization request by passing in props. See {@link SignUpProps}.\n *\n * **Note⚠️: You need to set the env `MONOCLOUD_AUTH_ALLOW_QUERY_PARAM_OVERRIDES=true` or `allowQueryParamOverrides` should be `true` in the client initialization for props to work**\n *\n * ```tsx\n * import { SignUp } from \"@monocloud/auth-nextjs/components\";\n *\n * export default function Home() {\n * return <SignUp returnUrl=\"/dashboard\">Sign Up</SignUp>;\n * }\n * ```\n */\nexport const SignUp = ({\n children,\n returnUrl,\n acrValues,\n display,\n maxAge,\n resource,\n scopes,\n uiLocales,\n ...props\n}: SignUpProps &\n Omit<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n 'resource'\n >): JSX.Element => {\n const signInUrl =\n process.env.NEXT_PUBLIC_MONOCLOUD_AUTH_SIGNIN_URL ??\n // eslint-disable-next-line no-underscore-dangle\n `${process.env.__NEXT_ROUTER_BASEPATH ?? ''}/api/auth/signin`;\n\n const query = new URLSearchParams();\n\n query.set('prompt', 'create');\n\n if (returnUrl) {\n query.set('return_url', returnUrl);\n }\n\n if (display) {\n query.set('display', display);\n }\n\n if (uiLocales) {\n query.set('ui_locales', uiLocales);\n }\n\n if (scopes) {\n query.set('scope', scopes);\n }\n\n if (acrValues) {\n query.set('acr_values', acrValues.join(' '));\n }\n\n if (resource) {\n query.set('resource', resource);\n }\n\n if (maxAge) {\n query.set('max_age', maxAge.toString());\n }\n\n if (returnUrl) {\n query.set('return_url', returnUrl);\n }\n\n return (\n <a href={`${signInUrl}?${query.toString()}`} {...props}>\n {children}\n </a>\n );\n};\n","import React, { JSX } from 'react';\n\nexport interface SignOutProps {\n /** URL to redirect the user to after they have been signed out. */\n postLogoutUrl?: string;\n\n /** Whether to also sign out the user from MonoCloud */\n federated?: boolean;\n}\n\n/**\n * A component that renders an anchor tag configured to initiate the sign-out flow.\n *\n * @param props - Properties for the SignOut component.\n *\n * @returns An anchor element that links to the sign-out endpoint.\n *\n * @example App Router and Pages Router\n *\n * **Sign-out component works on both the server and the client in pages router and app router.**\n *\n * ```tsx\n * import { SignOut } from \"@monocloud/auth-nextjs/components\";\n *\n * export default function Home() {\n * return <SignOut>Sign Out</SignOut>;\n * }\n * ```\n *\n * @example Customize the request\n *\n * You can customize the request by passing in props. See {@link SignOutProps}.\n *\n * **Note⚠️: You need to set the env `MONOCLOUD_AUTH_ALLOW_QUERY_PARAM_OVERRIDES=true` or `allowQueryParamOverrides` should be `true` in the client initialization for props to work**\n *\n * ```tsx\n * import { SignOut } from \"@monocloud/auth-nextjs/components\";\n *\n * export default function Home() {\n * return <SignOut federated={true}>Sign Out</SignOut>;\n * }\n * ```\n */\nexport const SignOut = ({\n children,\n postLogoutUrl,\n federated,\n ...props\n}: SignOutProps &\n React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element => {\n const signOutUrl =\n process.env.NEXT_PUBLIC_MONOCLOUD_AUTH_SIGNOUT_URL ??\n // eslint-disable-next-line no-underscore-dangle\n `${process.env.__NEXT_ROUTER_BASEPATH ?? ''}/api/auth/signout`;\n\n const query = new URLSearchParams();\n\n if (postLogoutUrl) {\n query.set('post_logout_url', postLogoutUrl);\n }\n\n if (typeof federated === 'boolean') {\n query.set('federated', federated.toString());\n }\n\n return (\n <a\n href={`${signOutUrl}${query.size ? `?${query.toString()}` : ''}`}\n {...props}\n >\n {children}\n </a>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAa,UAAU,EACrB,UACA,mBACA,WACA,QACA,SACA,WACA,QACA,WACA,UACA,QACA,WACA,GAAG,YAKgB;CACnB,MAAM,YACJ,QAAQ,IAAI,yCAEZ,GAAG,QAAQ,IAAI,0BAA0B,GAAG;CAE9C,MAAM,QAAQ,IAAI,iBAAiB;AAEnC,KAAI,kBACF,OAAM,IAAI,sBAAsB,kBAAkB;AAGpD,KAAI,OACF,OAAM,IAAI,UAAU,OAAO;AAG7B,KAAI,QACF,OAAM,IAAI,WAAW,QAAQ;AAG/B,KAAI,UACF,OAAM,IAAI,cAAc,UAAU;AAGpC,KAAI,OACF,OAAM,IAAI,SAAS,OAAO;AAG5B,KAAI,UACF,OAAM,IAAI,cAAc,UAAU,KAAK,IAAI,CAAC;AAG9C,KAAI,SACF,OAAM,IAAI,YAAY,SAAS;AAGjC,KAAI,OACF,OAAM,IAAI,WAAW,OAAO,UAAU,CAAC;AAGzC,KAAI,UACF,OAAM,IAAI,cAAc,UAAU;AAGpC,KAAI,UACF,OAAM,IAAI,cAAc,UAAU;AAGpC,QACE,4CAAC;EACC,MAAM,GAAG,YAAY,MAAM,OAAO,IAAI,MAAM,UAAU,KAAK;EAC3D,GAAI;IAEH,SACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxER,MAAa,UAAU,EACrB,UACA,WACA,WACA,SACA,QACA,UACA,QACA,WACA,GAAG,YAKgB;CACnB,MAAM,YACJ,QAAQ,IAAI,yCAEZ,GAAG,QAAQ,IAAI,0BAA0B,GAAG;CAE9C,MAAM,QAAQ,IAAI,iBAAiB;AAEnC,OAAM,IAAI,UAAU,SAAS;AAE7B,KAAI,UACF,OAAM,IAAI,cAAc,UAAU;AAGpC,KAAI,QACF,OAAM,IAAI,WAAW,QAAQ;AAG/B,KAAI,UACF,OAAM,IAAI,cAAc,UAAU;AAGpC,KAAI,OACF,OAAM,IAAI,SAAS,OAAO;AAG5B,KAAI,UACF,OAAM,IAAI,cAAc,UAAU,KAAK,IAAI,CAAC;AAG9C,KAAI,SACF,OAAM,IAAI,YAAY,SAAS;AAGjC,KAAI,OACF,OAAM,IAAI,WAAW,OAAO,UAAU,CAAC;AAGzC,KAAI,UACF,OAAM,IAAI,cAAc,UAAU;AAGpC,QACE,4CAAC;EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,UAAU;EAAI,GAAI;IAC9C,SACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/DR,MAAa,WAAW,EACtB,UACA,eACA,WACA,GAAG,YAE4D;CAC/D,MAAM,aACJ,QAAQ,IAAI,0CAEZ,GAAG,QAAQ,IAAI,0BAA0B,GAAG;CAE9C,MAAM,QAAQ,IAAI,iBAAiB;AAEnC,KAAI,cACF,OAAM,IAAI,mBAAmB,cAAc;AAG7C,KAAI,OAAO,cAAc,UACvB,OAAM,IAAI,aAAa,UAAU,UAAU,CAAC;AAG9C,QACE,4CAAC;EACC,MAAM,GAAG,aAAa,MAAM,OAAO,IAAI,MAAM,UAAU,KAAK;EAC5D,GAAI;IAEH,SACC"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/components/signin.tsx","../../src/components/signup.tsx","../../src/components/signout.tsx"],"sourcesContent":["import React from 'react';\nimport { ExtraAuthParams } from '../types';\n\n/**\n * Props for the `<SignIn />` component.\n *\n * @category Types\n */\nexport interface SignInProps extends ExtraAuthParams {\n /**\n * Content rendered inside the link (for example, button text).\n */\n children: React.ReactNode;\n\n /**\n * URL to redirect to after successful sign-in.\n */\n returnUrl?: string;\n}\n\n/**\n * `<SignIn>` renders a link that initiates the MonoCloud sign-in flow.\n *\n * It can be used in both **App Router** and **Pages Router**, and may be rendered from either **Server** or **Client Components**.\n *\n * @example Basic Usage\n *\n * ```tsx title=\"Basic Usage\"\n * import { SignIn } from \"@monocloud/auth-nextjs/components\";\n *\n * export default function Home() {\n * return <SignIn>Sign In</SignIn>;\n * }\n * ```\n *\n * @example Customize the authorization request\n *\n * You can customize the authorization request by passing props:\n *\n * ```tsx title=\"Customize the authorization request\"\n * import { SignIn } from \"@monocloud/auth-nextjs/components\";\n *\n * export default function Home() {\n * return (\n * <SignIn loginHint=\"user@example.com\" authenticatorHint=\"password\" returnUrl=\"/dashboard\">\n * Sign In\n * </SignIn>\n * );\n * }\n * ```\n *\n * @param props - Properties for the SignIn component.\n * @returns An anchor element that links to the sign-in endpoint with the specified parameters.\n *\n * @category Components\n */\nexport const SignIn = ({\n children,\n authenticatorHint,\n loginHint,\n prompt,\n display,\n uiLocales,\n scopes,\n acrValues,\n resource,\n maxAge,\n returnUrl,\n ...props\n}: SignInProps &\n Omit<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n 'resource'\n >): React.ReactNode => {\n const signInUrl =\n process.env.NEXT_PUBLIC_MONOCLOUD_AUTH_SIGNIN_URL ??\n // eslint-disable-next-line no-underscore-dangle\n `${process.env.__NEXT_ROUTER_BASEPATH ?? ''}/api/auth/signin`;\n\n const query = new URLSearchParams();\n\n if (authenticatorHint) {\n query.set('authenticator_hint', authenticatorHint);\n }\n\n if (prompt) {\n query.set('prompt', prompt);\n }\n\n if (display) {\n query.set('display', display);\n }\n\n if (uiLocales) {\n query.set('ui_locales', uiLocales);\n }\n\n if (scopes) {\n query.set('scope', scopes);\n }\n\n if (acrValues) {\n query.set('acr_values', acrValues.join(' '));\n }\n\n if (resource) {\n query.set('resource', resource);\n }\n\n if (maxAge) {\n query.set('max_age', maxAge.toString());\n }\n\n if (loginHint) {\n query.set('login_hint', loginHint);\n }\n\n if (returnUrl) {\n query.set('return_url', returnUrl);\n }\n\n return (\n <a\n href={`${signInUrl}${query.size ? `?${query.toString()}` : ''}`}\n {...props}\n >\n {children}\n </a>\n );\n};\n","import React from 'react';\nimport { ExtraAuthParams } from '../types';\n\n/**\n * Props for the `<SignUp />` component.\n *\n * @category Types\n */\nexport interface SignUpProps extends Omit<\n ExtraAuthParams,\n 'authenticatorHint' | 'loginHint' | 'prompt'\n> {\n /**\n * URL to redirect to after successful sign-up.\n */\n returnUrl?: string;\n}\n\n/**\n * `<SignUp>` renders a link that initiates the MonoCloud sign-up flow.\n *\n * It works in both **App Router** and **Pages Router**, and may be rendered from either **Server** or **Client Components**.\n *\n * Internally, it behaves like `<SignIn>` but sets `prompt=create` to start the registration flow.\n *\n * @example Basic usage\n *\n * ```tsx title=\"Basic Usage\"\n * import { SignUp } from \"@monocloud/auth-nextjs/components\";\n *\n * export default function Home() {\n * return <SignUp>Sign Up</SignUp>;\n * }\n * ```\n *\n * @example Customize the authorization request\n *\n * You can customize the authorization request by passing in props.\n *\n * ```tsx title=\"Customize the authorization request\"\n * import { SignUp } from \"@monocloud/auth-nextjs/components\";\n *\n * export default function Home() {\n * return (\n * <SignUp\n * returnUrl=\"/dashboard\"\n * uiLocales=\"en\"\n * >\n * Sign Up\n * </SignUp>\n * );\n * }\n * ```\n *\n * @param props - Properties for the SignUp component.\n * @returns An anchor element that links to the sign-in endpoint with the prompt set to 'create'.\n *\n * @category Components\n */\nexport const SignUp = ({\n children,\n returnUrl,\n acrValues,\n display,\n maxAge,\n resource,\n scopes,\n uiLocales,\n ...props\n}: SignUpProps &\n Omit<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n 'resource'\n >): React.ReactNode => {\n const signInUrl =\n process.env.NEXT_PUBLIC_MONOCLOUD_AUTH_SIGNIN_URL ??\n // eslint-disable-next-line no-underscore-dangle\n `${process.env.__NEXT_ROUTER_BASEPATH ?? ''}/api/auth/signin`;\n\n const query = new URLSearchParams();\n\n query.set('prompt', 'create');\n\n if (returnUrl) {\n query.set('return_url', returnUrl);\n }\n\n if (display) {\n query.set('display', display);\n }\n\n if (uiLocales) {\n query.set('ui_locales', uiLocales);\n }\n\n if (scopes) {\n query.set('scope', scopes);\n }\n\n if (acrValues) {\n query.set('acr_values', acrValues.join(' '));\n }\n\n if (resource) {\n query.set('resource', resource);\n }\n\n if (maxAge) {\n query.set('max_age', maxAge.toString());\n }\n\n if (returnUrl) {\n query.set('return_url', returnUrl);\n }\n\n return (\n <a href={`${signInUrl}?${query.toString()}`} {...props}>\n {children}\n </a>\n );\n};\n","import React from 'react';\n\n/**\n * Props for the `<SignOut />` component.\n *\n * @category Types\n */\nexport interface SignOutProps {\n /** Content rendered inside the link (for example, button text). */\n children: React.ReactNode;\n\n /** URL to redirect the user to after they have been signed out. */\n postLogoutUrl?: string;\n\n /** If `true`, also signs the user out of the MonoCloud server session, ensuring the user is fully logged out of MonoCloud and not just your application. */\n federated?: boolean;\n}\n\n/**\n * `<SignOut>` renders a link that initiates the MonoCloud sign-out flow.\n *\n * It can be used in both **App Router** and **Pages Router**, and may be rendered from either **Server** or **Client Components**.\n *\n * @example Basic usage\n *\n * ```tsx title=\"Basic Usage\"\n * import { SignOut } from \"@monocloud/auth-nextjs/components\";\n *\n * export default function Home() {\n * return <SignOut>Sign Out</SignOut>;\n * }\n * ```\n *\n * @example Customize the sign-out request\n *\n * ```tsx title=\"Customize the sign-out request\"\n * import { SignOut } from \"@monocloud/auth-nextjs/components\";\n *\n * export default function Home() {\n * return <SignOut federated postLogoutUrl=\"/goodbye\">Sign Out</SignOut>;\n * }\n * ```\n *\n * @param props - Properties for the SignOut component.\n * @returns An anchor element that links to the sign-out endpoint.\n *\n * @category Components\n */\nexport const SignOut = ({\n children,\n postLogoutUrl,\n federated,\n ...props\n}: SignOutProps &\n React.AnchorHTMLAttributes<HTMLAnchorElement>): React.ReactNode => {\n const signOutUrl =\n process.env.NEXT_PUBLIC_MONOCLOUD_AUTH_SIGNOUT_URL ??\n // eslint-disable-next-line no-underscore-dangle\n `${process.env.__NEXT_ROUTER_BASEPATH ?? ''}/api/auth/signout`;\n\n const query = new URLSearchParams();\n\n if (postLogoutUrl) {\n query.set('post_logout_url', postLogoutUrl);\n }\n\n if (typeof federated === 'boolean') {\n query.set('federated', federated.toString());\n }\n\n return (\n <a\n href={`${signOutUrl}${query.size ? `?${query.toString()}` : ''}`}\n {...props}\n >\n {children}\n </a>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,MAAa,UAAU,EACrB,UACA,mBACA,WACA,QACA,SACA,WACA,QACA,WACA,UACA,QACA,WACA,GAAG,YAKoB;CACvB,MAAM,YACJ,QAAQ,IAAI,yCAEZ,GAAG,QAAQ,IAAI,0BAA0B,GAAG;CAE9C,MAAM,QAAQ,IAAI,iBAAiB;AAEnC,KAAI,kBACF,OAAM,IAAI,sBAAsB,kBAAkB;AAGpD,KAAI,OACF,OAAM,IAAI,UAAU,OAAO;AAG7B,KAAI,QACF,OAAM,IAAI,WAAW,QAAQ;AAG/B,KAAI,UACF,OAAM,IAAI,cAAc,UAAU;AAGpC,KAAI,OACF,OAAM,IAAI,SAAS,OAAO;AAG5B,KAAI,UACF,OAAM,IAAI,cAAc,UAAU,KAAK,IAAI,CAAC;AAG9C,KAAI,SACF,OAAM,IAAI,YAAY,SAAS;AAGjC,KAAI,OACF,OAAM,IAAI,WAAW,OAAO,UAAU,CAAC;AAGzC,KAAI,UACF,OAAM,IAAI,cAAc,UAAU;AAGpC,KAAI,UACF,OAAM,IAAI,cAAc,UAAU;AAGpC,QACE,4CAAC;EACC,MAAM,GAAG,YAAY,MAAM,OAAO,IAAI,MAAM,UAAU,KAAK;EAC3D,GAAI;IAEH,SACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpER,MAAa,UAAU,EACrB,UACA,WACA,WACA,SACA,QACA,UACA,QACA,WACA,GAAG,YAKoB;CACvB,MAAM,YACJ,QAAQ,IAAI,yCAEZ,GAAG,QAAQ,IAAI,0BAA0B,GAAG;CAE9C,MAAM,QAAQ,IAAI,iBAAiB;AAEnC,OAAM,IAAI,UAAU,SAAS;AAE7B,KAAI,UACF,OAAM,IAAI,cAAc,UAAU;AAGpC,KAAI,QACF,OAAM,IAAI,WAAW,QAAQ;AAG/B,KAAI,UACF,OAAM,IAAI,cAAc,UAAU;AAGpC,KAAI,OACF,OAAM,IAAI,SAAS,OAAO;AAG5B,KAAI,UACF,OAAM,IAAI,cAAc,UAAU,KAAK,IAAI,CAAC;AAG9C,KAAI,SACF,OAAM,IAAI,YAAY,SAAS;AAGjC,KAAI,OACF,OAAM,IAAI,WAAW,OAAO,UAAU,CAAC;AAGzC,KAAI,UACF,OAAM,IAAI,cAAc,UAAU;AAGpC,QACE,4CAAC;EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,UAAU;EAAI,GAAI;IAC9C,SACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtER,MAAa,WAAW,EACtB,UACA,eACA,WACA,GAAG,YAEgE;CACnE,MAAM,aACJ,QAAQ,IAAI,0CAEZ,GAAG,QAAQ,IAAI,0BAA0B,GAAG;CAE9C,MAAM,QAAQ,IAAI,iBAAiB;AAEnC,KAAI,cACF,OAAM,IAAI,mBAAmB,cAAc;AAG7C,KAAI,OAAO,cAAc,UACvB,OAAM,IAAI,aAAa,UAAU,UAAU,CAAC;AAG9C,QACE,4CAAC;EACC,MAAM,GAAG,aAAa,MAAM,OAAO,IAAI,MAAM,UAAU,KAAK;EAC5D,GAAI;IAEH,SACC"}
@@ -1,26 +1,30 @@
1
- import { i as ExtraAuthParams } from "../types-CsBjAJce.mjs";
2
- import React, { JSX } from "react";
1
+ import { c as ExtraAuthParams } from "../types-xS_Me3Qg.mjs";
2
+ import React from "react";
3
3
 
4
4
  //#region src/components/signin.d.ts
5
+ /**
6
+ * Props for the `<SignIn />` component.
7
+ *
8
+ * @category Types
9
+ */
5
10
  interface SignInProps extends ExtraAuthParams {
11
+ /**
12
+ * Content rendered inside the link (for example, button text).
13
+ */
6
14
  children: React.ReactNode;
7
15
  /**
8
- * URL to redirect to after a successful sign-in.
16
+ * URL to redirect to after successful sign-in.
9
17
  */
10
18
  returnUrl?: string;
11
19
  }
12
20
  /**
13
- * A component that renders an anchor tag configured to initiate the sign-in flow.
21
+ * `<SignIn>` renders a link that initiates the MonoCloud sign-in flow.
14
22
  *
15
- * @param props - Properties for the SignIn component.
23
+ * It can be used in both **App Router** and **Pages Router**, and may be rendered from either **Server** or **Client Components**.
16
24
  *
17
- * @returns An anchor element that links to the sign-in endpoint with the specified parameters.
18
- *
19
- * @example App Router and Pages Router
20
- *
21
- * **Sign-in component works on both the server and the client in pages router and app router.**
25
+ * @example Basic Usage
22
26
  *
23
- * ```tsx
27
+ * ```tsx title="Basic Usage"
24
28
  * import { SignIn } from "@monocloud/auth-nextjs/components";
25
29
  *
26
30
  * export default function Home() {
@@ -30,21 +34,24 @@ interface SignInProps extends ExtraAuthParams {
30
34
  *
31
35
  * @example Customize the authorization request
32
36
  *
33
- * You can customize the authorization request by passing in props. See {@link SignInProps}.
37
+ * You can customize the authorization request by passing props:
34
38
  *
35
- * **Note⚠️: You need to set the env `MONOCLOUD_AUTH_ALLOW_QUERY_PARAM_OVERRIDES=true` or `allowQueryParamOverrides` should be `true` in the client initialization for props to work**
36
- *
37
- * ```tsx
39
+ * ```tsx title="Customize the authorization request"
38
40
  * import { SignIn } from "@monocloud/auth-nextjs/components";
39
41
  *
40
42
  * export default function Home() {
41
43
  * return (
42
- * <SignIn loginHint="username" authenticatorHint="password">
44
+ * <SignIn loginHint="user@example.com" authenticatorHint="password" returnUrl="/dashboard">
43
45
  * Sign In
44
46
  * </SignIn>
45
47
  * );
46
48
  * }
47
49
  * ```
50
+ *
51
+ * @param props - Properties for the SignIn component.
52
+ * @returns An anchor element that links to the sign-in endpoint with the specified parameters.
53
+ *
54
+ * @category Components
48
55
  */
49
56
  declare const SignIn: ({
50
57
  children,
@@ -59,28 +66,30 @@ declare const SignIn: ({
59
66
  maxAge,
60
67
  returnUrl,
61
68
  ...props
62
- }: SignInProps & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "resource">) => JSX.Element;
69
+ }: SignInProps & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "resource">) => React.ReactNode;
63
70
  //#endregion
64
71
  //#region src/components/signup.d.ts
72
+ /**
73
+ * Props for the `<SignUp />` component.
74
+ *
75
+ * @category Types
76
+ */
65
77
  interface SignUpProps extends Omit<ExtraAuthParams, 'authenticatorHint' | 'loginHint' | 'prompt'> {
66
78
  /**
67
- * URL to redirect to after a successful sign-up.
79
+ * URL to redirect to after successful sign-up.
68
80
  */
69
81
  returnUrl?: string;
70
82
  }
71
83
  /**
72
- * A component that renders an anchor tag configured to initiate the sign-up flow.
73
- * * It functions similarly to the SignIn component but explicitly sets the `prompt` parameter to `create`.
84
+ * `<SignUp>` renders a link that initiates the MonoCloud sign-up flow.
74
85
  *
75
- * @param props - Properties for the SignUp component.
86
+ * It works in both **App Router** and **Pages Router**, and may be rendered from either **Server** or **Client Components**.
76
87
  *
77
- * @returns An anchor element that links to the sign-in endpoint with the prompt set to 'create'.
88
+ * Internally, it behaves like `<SignIn>` but sets `prompt=create` to start the registration flow.
78
89
  *
79
- * @example App Router and Pages Router
90
+ * @example Basic usage
80
91
  *
81
- * **Sign-up component works on both the server and the client in pages router and app router.**
82
- *
83
- * ```tsx
92
+ * ```tsx title="Basic Usage"
84
93
  * import { SignUp } from "@monocloud/auth-nextjs/components";
85
94
  *
86
95
  * export default function Home() {
@@ -90,17 +99,27 @@ interface SignUpProps extends Omit<ExtraAuthParams, 'authenticatorHint' | 'login
90
99
  *
91
100
  * @example Customize the authorization request
92
101
  *
93
- * You can customize the authorization request by passing in props. See {@link SignUpProps}.
94
- *
95
- * **Note⚠️: You need to set the env `MONOCLOUD_AUTH_ALLOW_QUERY_PARAM_OVERRIDES=true` or `allowQueryParamOverrides` should be `true` in the client initialization for props to work**
102
+ * You can customize the authorization request by passing in props.
96
103
  *
97
- * ```tsx
104
+ * ```tsx title="Customize the authorization request"
98
105
  * import { SignUp } from "@monocloud/auth-nextjs/components";
99
106
  *
100
107
  * export default function Home() {
101
- * return <SignUp returnUrl="/dashboard">Sign Up</SignUp>;
108
+ * return (
109
+ * <SignUp
110
+ * returnUrl="/dashboard"
111
+ * uiLocales="en"
112
+ * >
113
+ * Sign Up
114
+ * </SignUp>
115
+ * );
102
116
  * }
103
117
  * ```
118
+ *
119
+ * @param props - Properties for the SignUp component.
120
+ * @returns An anchor element that links to the sign-in endpoint with the prompt set to 'create'.
121
+ *
122
+ * @category Components
104
123
  */
105
124
  declare const SignUp: ({
106
125
  children,
@@ -112,27 +131,30 @@ declare const SignUp: ({
112
131
  scopes,
113
132
  uiLocales,
114
133
  ...props
115
- }: SignUpProps & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "resource">) => JSX.Element;
134
+ }: SignUpProps & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "resource">) => React.ReactNode;
116
135
  //#endregion
117
136
  //#region src/components/signout.d.ts
137
+ /**
138
+ * Props for the `<SignOut />` component.
139
+ *
140
+ * @category Types
141
+ */
118
142
  interface SignOutProps {
143
+ /** Content rendered inside the link (for example, button text). */
144
+ children: React.ReactNode;
119
145
  /** URL to redirect the user to after they have been signed out. */
120
146
  postLogoutUrl?: string;
121
- /** Whether to also sign out the user from MonoCloud */
147
+ /** If `true`, also signs the user out of the MonoCloud server session, ensuring the user is fully logged out of MonoCloud and not just your application. */
122
148
  federated?: boolean;
123
149
  }
124
150
  /**
125
- * A component that renders an anchor tag configured to initiate the sign-out flow.
151
+ * `<SignOut>` renders a link that initiates the MonoCloud sign-out flow.
126
152
  *
127
- * @param props - Properties for the SignOut component.
128
- *
129
- * @returns An anchor element that links to the sign-out endpoint.
153
+ * It can be used in both **App Router** and **Pages Router**, and may be rendered from either **Server** or **Client Components**.
130
154
  *
131
- * @example App Router and Pages Router
155
+ * @example Basic usage
132
156
  *
133
- * **Sign-out component works on both the server and the client in pages router and app router.**
134
- *
135
- * ```tsx
157
+ * ```tsx title="Basic Usage"
136
158
  * import { SignOut } from "@monocloud/auth-nextjs/components";
137
159
  *
138
160
  * export default function Home() {
@@ -140,26 +162,27 @@ interface SignOutProps {
140
162
  * }
141
163
  * ```
142
164
  *
143
- * @example Customize the request
144
- *
145
- * You can customize the request by passing in props. See {@link SignOutProps}.
165
+ * @example Customize the sign-out request
146
166
  *
147
- * **Note⚠️: You need to set the env `MONOCLOUD_AUTH_ALLOW_QUERY_PARAM_OVERRIDES=true` or `allowQueryParamOverrides` should be `true` in the client initialization for props to work**
148
- *
149
- * ```tsx
167
+ * ```tsx title="Customize the sign-out request"
150
168
  * import { SignOut } from "@monocloud/auth-nextjs/components";
151
169
  *
152
170
  * export default function Home() {
153
- * return <SignOut federated={true}>Sign Out</SignOut>;
171
+ * return <SignOut federated postLogoutUrl="/goodbye">Sign Out</SignOut>;
154
172
  * }
155
173
  * ```
174
+ *
175
+ * @param props - Properties for the SignOut component.
176
+ * @returns An anchor element that links to the sign-out endpoint.
177
+ *
178
+ * @category Components
156
179
  */
157
180
  declare const SignOut: ({
158
181
  children,
159
182
  postLogoutUrl,
160
183
  federated,
161
184
  ...props
162
- }: SignOutProps & React.AnchorHTMLAttributes<HTMLAnchorElement>) => JSX.Element;
185
+ }: SignOutProps & React.AnchorHTMLAttributes<HTMLAnchorElement>) => React.ReactNode;
163
186
  //#endregion
164
187
  export { SignIn, type SignInProps, SignOut, type SignOutProps, SignUp, type SignUpProps };
165
188
  //# sourceMappingURL=index.d.mts.map
@@ -2,17 +2,13 @@ import React from "react";
2
2
 
3
3
  //#region src/components/signin.tsx
4
4
  /**
5
- * A component that renders an anchor tag configured to initiate the sign-in flow.
5
+ * `<SignIn>` renders a link that initiates the MonoCloud sign-in flow.
6
6
  *
7
- * @param props - Properties for the SignIn component.
8
- *
9
- * @returns An anchor element that links to the sign-in endpoint with the specified parameters.
10
- *
11
- * @example App Router and Pages Router
7
+ * It can be used in both **App Router** and **Pages Router**, and may be rendered from either **Server** or **Client Components**.
12
8
  *
13
- * **Sign-in component works on both the server and the client in pages router and app router.**
9
+ * @example Basic Usage
14
10
  *
15
- * ```tsx
11
+ * ```tsx title="Basic Usage"
16
12
  * import { SignIn } from "@monocloud/auth-nextjs/components";
17
13
  *
18
14
  * export default function Home() {
@@ -22,21 +18,24 @@ import React from "react";
22
18
  *
23
19
  * @example Customize the authorization request
24
20
  *
25
- * You can customize the authorization request by passing in props. See {@link SignInProps}.
21
+ * You can customize the authorization request by passing props:
26
22
  *
27
- * **Note⚠️: You need to set the env `MONOCLOUD_AUTH_ALLOW_QUERY_PARAM_OVERRIDES=true` or `allowQueryParamOverrides` should be `true` in the client initialization for props to work**
28
- *
29
- * ```tsx
23
+ * ```tsx title="Customize the authorization request"
30
24
  * import { SignIn } from "@monocloud/auth-nextjs/components";
31
25
  *
32
26
  * export default function Home() {
33
27
  * return (
34
- * <SignIn loginHint="username" authenticatorHint="password">
28
+ * <SignIn loginHint="user@example.com" authenticatorHint="password" returnUrl="/dashboard">
35
29
  * Sign In
36
30
  * </SignIn>
37
31
  * );
38
32
  * }
39
33
  * ```
34
+ *
35
+ * @param props - Properties for the SignIn component.
36
+ * @returns An anchor element that links to the sign-in endpoint with the specified parameters.
37
+ *
38
+ * @category Components
40
39
  */
41
40
  const SignIn = ({ children, authenticatorHint, loginHint, prompt, display, uiLocales, scopes, acrValues, resource, maxAge, returnUrl, ...props }) => {
42
41
  const signInUrl = process.env.NEXT_PUBLIC_MONOCLOUD_AUTH_SIGNIN_URL ?? `${process.env.__NEXT_ROUTER_BASEPATH ?? ""}/api/auth/signin`;
@@ -60,18 +59,15 @@ const SignIn = ({ children, authenticatorHint, loginHint, prompt, display, uiLoc
60
59
  //#endregion
61
60
  //#region src/components/signup.tsx
62
61
  /**
63
- * A component that renders an anchor tag configured to initiate the sign-up flow.
64
- * * It functions similarly to the SignIn component but explicitly sets the `prompt` parameter to `create`.
65
- *
66
- * @param props - Properties for the SignUp component.
62
+ * `<SignUp>` renders a link that initiates the MonoCloud sign-up flow.
67
63
  *
68
- * @returns An anchor element that links to the sign-in endpoint with the prompt set to 'create'.
64
+ * It works in both **App Router** and **Pages Router**, and may be rendered from either **Server** or **Client Components**.
69
65
  *
70
- * @example App Router and Pages Router
66
+ * Internally, it behaves like `<SignIn>` but sets `prompt=create` to start the registration flow.
71
67
  *
72
- * **Sign-up component works on both the server and the client in pages router and app router.**
68
+ * @example Basic usage
73
69
  *
74
- * ```tsx
70
+ * ```tsx title="Basic Usage"
75
71
  * import { SignUp } from "@monocloud/auth-nextjs/components";
76
72
  *
77
73
  * export default function Home() {
@@ -81,17 +77,27 @@ const SignIn = ({ children, authenticatorHint, loginHint, prompt, display, uiLoc
81
77
  *
82
78
  * @example Customize the authorization request
83
79
  *
84
- * You can customize the authorization request by passing in props. See {@link SignUpProps}.
80
+ * You can customize the authorization request by passing in props.
85
81
  *
86
- * **Note⚠️: You need to set the env `MONOCLOUD_AUTH_ALLOW_QUERY_PARAM_OVERRIDES=true` or `allowQueryParamOverrides` should be `true` in the client initialization for props to work**
87
- *
88
- * ```tsx
82
+ * ```tsx title="Customize the authorization request"
89
83
  * import { SignUp } from "@monocloud/auth-nextjs/components";
90
84
  *
91
85
  * export default function Home() {
92
- * return <SignUp returnUrl="/dashboard">Sign Up</SignUp>;
86
+ * return (
87
+ * <SignUp
88
+ * returnUrl="/dashboard"
89
+ * uiLocales="en"
90
+ * >
91
+ * Sign Up
92
+ * </SignUp>
93
+ * );
93
94
  * }
94
95
  * ```
96
+ *
97
+ * @param props - Properties for the SignUp component.
98
+ * @returns An anchor element that links to the sign-in endpoint with the prompt set to 'create'.
99
+ *
100
+ * @category Components
95
101
  */
96
102
  const SignUp = ({ children, returnUrl, acrValues, display, maxAge, resource, scopes, uiLocales, ...props }) => {
97
103
  const signInUrl = process.env.NEXT_PUBLIC_MONOCLOUD_AUTH_SIGNIN_URL ?? `${process.env.__NEXT_ROUTER_BASEPATH ?? ""}/api/auth/signin`;
@@ -114,17 +120,13 @@ const SignUp = ({ children, returnUrl, acrValues, display, maxAge, resource, sco
114
120
  //#endregion
115
121
  //#region src/components/signout.tsx
116
122
  /**
117
- * A component that renders an anchor tag configured to initiate the sign-out flow.
118
- *
119
- * @param props - Properties for the SignOut component.
120
- *
121
- * @returns An anchor element that links to the sign-out endpoint.
123
+ * `<SignOut>` renders a link that initiates the MonoCloud sign-out flow.
122
124
  *
123
- * @example App Router and Pages Router
125
+ * It can be used in both **App Router** and **Pages Router**, and may be rendered from either **Server** or **Client Components**.
124
126
  *
125
- * **Sign-out component works on both the server and the client in pages router and app router.**
127
+ * @example Basic usage
126
128
  *
127
- * ```tsx
129
+ * ```tsx title="Basic Usage"
128
130
  * import { SignOut } from "@monocloud/auth-nextjs/components";
129
131
  *
130
132
  * export default function Home() {
@@ -132,19 +134,20 @@ const SignUp = ({ children, returnUrl, acrValues, display, maxAge, resource, sco
132
134
  * }
133
135
  * ```
134
136
  *
135
- * @example Customize the request
136
- *
137
- * You can customize the request by passing in props. See {@link SignOutProps}.
137
+ * @example Customize the sign-out request
138
138
  *
139
- * **Note⚠️: You need to set the env `MONOCLOUD_AUTH_ALLOW_QUERY_PARAM_OVERRIDES=true` or `allowQueryParamOverrides` should be `true` in the client initialization for props to work**
140
- *
141
- * ```tsx
139
+ * ```tsx title="Customize the sign-out request"
142
140
  * import { SignOut } from "@monocloud/auth-nextjs/components";
143
141
  *
144
142
  * export default function Home() {
145
- * return <SignOut federated={true}>Sign Out</SignOut>;
143
+ * return <SignOut federated postLogoutUrl="/goodbye">Sign Out</SignOut>;
146
144
  * }
147
145
  * ```
146
+ *
147
+ * @param props - Properties for the SignOut component.
148
+ * @returns An anchor element that links to the sign-out endpoint.
149
+ *
150
+ * @category Components
148
151
  */
149
152
  const SignOut = ({ children, postLogoutUrl, federated, ...props }) => {
150
153
  const signOutUrl = process.env.NEXT_PUBLIC_MONOCLOUD_AUTH_SIGNOUT_URL ?? `${process.env.__NEXT_ROUTER_BASEPATH ?? ""}/api/auth/signout`;