@civic/auth 0.0.1-beta.0 → 0.0.1-beta.1
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/README.md +10 -10
- package/dist/index-DFVNodC9.d.mts +66 -0
- package/dist/index-DFVNodC9.d.ts +66 -0
- package/dist/index.css +5 -5
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/nextjs.d.mts +235 -4
- package/dist/nextjs.d.ts +235 -4
- package/dist/nextjs.js +848 -42
- package/dist/nextjs.js.map +1 -1
- package/dist/nextjs.mjs +832 -43
- package/dist/nextjs.mjs.map +1 -1
- package/dist/react.d.mts +71 -19
- package/dist/react.d.ts +71 -19
- package/dist/react.js +599 -300
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +588 -293
- package/dist/react.mjs.map +1 -1
- package/package.json +22 -18
- package/dist/index-yT0eVchS.d.mts +0 -52
- package/dist/index-yT0eVchS.d.ts +0 -52
package/README.md
CHANGED
|
@@ -33,34 +33,34 @@ First, import the CSS styles in your main application file (e.g., `_app.tsx` for
|
|
|
33
33
|
import "@civic/auth/styles.css";
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
### Setup
|
|
36
|
+
### Setup CivicAuthProvider
|
|
37
37
|
|
|
38
|
-
To use the Civic Auth Client SDK, wrap your application with the `
|
|
38
|
+
To use the Civic Auth Client SDK, wrap your application with the `CivicAuthProvider` component. This will allow the authentication context to be accessible throughout your app.
|
|
39
39
|
|
|
40
40
|
```tsx
|
|
41
|
-
import {
|
|
41
|
+
import { CivicAuthProvider } from "@civic/auth/react";
|
|
42
42
|
|
|
43
43
|
function App({ children }) {
|
|
44
44
|
return (
|
|
45
|
-
<
|
|
45
|
+
<CivicAuthProvider clientId="your-client-id" redirectUrl="https://your-app.com/callback">
|
|
46
46
|
{children}
|
|
47
|
-
</
|
|
47
|
+
</CivicAuthProvider>
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
The only required prop for `
|
|
52
|
+
The only required prop for `CivicAuthProvider` is the `clientId`. By default, the SDK uses Civic's endpoints. If you need to use your own endpoints, you can provide them using the `config` prop. See the advanced configuration section below for more details.
|
|
53
53
|
|
|
54
54
|
### Advanced Configuration
|
|
55
55
|
|
|
56
|
-
If you want to use your own endpoints, you can pass a `config` object to the `
|
|
56
|
+
If you want to use your own endpoints, you can pass a `config` object to the `CivicAuthProvider` as shown below:
|
|
57
57
|
|
|
58
58
|
```tsx
|
|
59
|
-
import {
|
|
59
|
+
import { CivicAuthProvider } from "@civic/auth/react";
|
|
60
60
|
|
|
61
61
|
function App({ children }) {
|
|
62
62
|
return (
|
|
63
|
-
<
|
|
63
|
+
<CivicAuthProvider
|
|
64
64
|
clientId="your-client-id"
|
|
65
65
|
redirectUrl="https://your-app.com/callback"
|
|
66
66
|
config={{
|
|
@@ -72,7 +72,7 @@ function App({ children }) {
|
|
|
72
72
|
}}
|
|
73
73
|
>
|
|
74
74
|
{children}
|
|
75
|
-
</
|
|
75
|
+
</CivicAuthProvider>
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
```
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { TokenResponseBody } from 'oslo/oauth2';
|
|
2
|
+
|
|
3
|
+
type UnknownObject = Record<string, unknown>;
|
|
4
|
+
type EmptyObject = Record<string, never>;
|
|
5
|
+
type DisplayMode = "iframe" | "redirect" | "new_tab" | "custom_tab";
|
|
6
|
+
interface AuthSessionService {
|
|
7
|
+
loadAuthorizationUrl(authorizationURL: string, displayMode: DisplayMode): void;
|
|
8
|
+
getAuthorizationUrl(scopes: string[], overrideDisplayMode: DisplayMode, nonce?: string): Promise<string>;
|
|
9
|
+
signIn(displayMode: DisplayMode, scopes: string[], nonce?: string): Promise<void>;
|
|
10
|
+
tokenExchange(responseUrl: string): Promise<SessionData>;
|
|
11
|
+
getSessionData(): SessionData;
|
|
12
|
+
updateSessionData(data: SessionData): void;
|
|
13
|
+
getUserInfoService(): Promise<UserInfoService>;
|
|
14
|
+
}
|
|
15
|
+
interface UserInfoService {
|
|
16
|
+
getUserInfo<T extends UnknownObject>(accessToken: string, idToken: string | null): Promise<User<T> | null>;
|
|
17
|
+
}
|
|
18
|
+
type Endpoints = {
|
|
19
|
+
jwks: string;
|
|
20
|
+
auth: string;
|
|
21
|
+
token: string;
|
|
22
|
+
userinfo: string;
|
|
23
|
+
challenge?: string;
|
|
24
|
+
};
|
|
25
|
+
type Config = {
|
|
26
|
+
oauthServer: string;
|
|
27
|
+
endpoints?: Endpoints;
|
|
28
|
+
};
|
|
29
|
+
type SessionData = {
|
|
30
|
+
authenticated: boolean;
|
|
31
|
+
state?: string;
|
|
32
|
+
accessToken?: string;
|
|
33
|
+
refreshToken?: string;
|
|
34
|
+
idToken?: string;
|
|
35
|
+
timestamp?: number;
|
|
36
|
+
expiresIn?: number;
|
|
37
|
+
codeVerifier?: string;
|
|
38
|
+
displayMode?: DisplayMode;
|
|
39
|
+
openerUrl?: string;
|
|
40
|
+
};
|
|
41
|
+
type OIDCTokenResponseBody = TokenResponseBody & {
|
|
42
|
+
id_token: string;
|
|
43
|
+
};
|
|
44
|
+
type ForwardedTokens = Record<string, {
|
|
45
|
+
idToken?: string;
|
|
46
|
+
accessToken?: string;
|
|
47
|
+
refreshToken?: string;
|
|
48
|
+
}>;
|
|
49
|
+
type Tokens = {
|
|
50
|
+
idToken: string;
|
|
51
|
+
accessToken: string;
|
|
52
|
+
refreshToken: string;
|
|
53
|
+
forwardedTokens: ForwardedTokens;
|
|
54
|
+
};
|
|
55
|
+
type BaseUser = {
|
|
56
|
+
id: string;
|
|
57
|
+
email?: string;
|
|
58
|
+
name?: string;
|
|
59
|
+
given_name?: string;
|
|
60
|
+
family_name?: string;
|
|
61
|
+
picture?: string;
|
|
62
|
+
updated_at?: Date;
|
|
63
|
+
};
|
|
64
|
+
type User<T extends UnknownObject = EmptyObject> = BaseUser & Tokens & T;
|
|
65
|
+
|
|
66
|
+
export type { AuthSessionService as A, Config as C, DisplayMode as D, Endpoints as E, ForwardedTokens as F, OIDCTokenResponseBody as O, SessionData as S, Tokens as T, UserInfoService as U, User as a, UnknownObject as b };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { TokenResponseBody } from 'oslo/oauth2';
|
|
2
|
+
|
|
3
|
+
type UnknownObject = Record<string, unknown>;
|
|
4
|
+
type EmptyObject = Record<string, never>;
|
|
5
|
+
type DisplayMode = "iframe" | "redirect" | "new_tab" | "custom_tab";
|
|
6
|
+
interface AuthSessionService {
|
|
7
|
+
loadAuthorizationUrl(authorizationURL: string, displayMode: DisplayMode): void;
|
|
8
|
+
getAuthorizationUrl(scopes: string[], overrideDisplayMode: DisplayMode, nonce?: string): Promise<string>;
|
|
9
|
+
signIn(displayMode: DisplayMode, scopes: string[], nonce?: string): Promise<void>;
|
|
10
|
+
tokenExchange(responseUrl: string): Promise<SessionData>;
|
|
11
|
+
getSessionData(): SessionData;
|
|
12
|
+
updateSessionData(data: SessionData): void;
|
|
13
|
+
getUserInfoService(): Promise<UserInfoService>;
|
|
14
|
+
}
|
|
15
|
+
interface UserInfoService {
|
|
16
|
+
getUserInfo<T extends UnknownObject>(accessToken: string, idToken: string | null): Promise<User<T> | null>;
|
|
17
|
+
}
|
|
18
|
+
type Endpoints = {
|
|
19
|
+
jwks: string;
|
|
20
|
+
auth: string;
|
|
21
|
+
token: string;
|
|
22
|
+
userinfo: string;
|
|
23
|
+
challenge?: string;
|
|
24
|
+
};
|
|
25
|
+
type Config = {
|
|
26
|
+
oauthServer: string;
|
|
27
|
+
endpoints?: Endpoints;
|
|
28
|
+
};
|
|
29
|
+
type SessionData = {
|
|
30
|
+
authenticated: boolean;
|
|
31
|
+
state?: string;
|
|
32
|
+
accessToken?: string;
|
|
33
|
+
refreshToken?: string;
|
|
34
|
+
idToken?: string;
|
|
35
|
+
timestamp?: number;
|
|
36
|
+
expiresIn?: number;
|
|
37
|
+
codeVerifier?: string;
|
|
38
|
+
displayMode?: DisplayMode;
|
|
39
|
+
openerUrl?: string;
|
|
40
|
+
};
|
|
41
|
+
type OIDCTokenResponseBody = TokenResponseBody & {
|
|
42
|
+
id_token: string;
|
|
43
|
+
};
|
|
44
|
+
type ForwardedTokens = Record<string, {
|
|
45
|
+
idToken?: string;
|
|
46
|
+
accessToken?: string;
|
|
47
|
+
refreshToken?: string;
|
|
48
|
+
}>;
|
|
49
|
+
type Tokens = {
|
|
50
|
+
idToken: string;
|
|
51
|
+
accessToken: string;
|
|
52
|
+
refreshToken: string;
|
|
53
|
+
forwardedTokens: ForwardedTokens;
|
|
54
|
+
};
|
|
55
|
+
type BaseUser = {
|
|
56
|
+
id: string;
|
|
57
|
+
email?: string;
|
|
58
|
+
name?: string;
|
|
59
|
+
given_name?: string;
|
|
60
|
+
family_name?: string;
|
|
61
|
+
picture?: string;
|
|
62
|
+
updated_at?: Date;
|
|
63
|
+
};
|
|
64
|
+
type User<T extends UnknownObject = EmptyObject> = BaseUser & Tokens & T;
|
|
65
|
+
|
|
66
|
+
export type { AuthSessionService as A, Config as C, DisplayMode as D, Endpoints as E, ForwardedTokens as F, OIDCTokenResponseBody as O, SessionData as S, Tokens as T, UserInfoService as U, User as a, UnknownObject as b };
|
package/dist/index.css
CHANGED
|
@@ -142,8 +142,8 @@
|
|
|
142
142
|
.top-4 {
|
|
143
143
|
top: 1rem;
|
|
144
144
|
}
|
|
145
|
-
.z
|
|
146
|
-
z-index:
|
|
145
|
+
.z-50 {
|
|
146
|
+
z-index: 50;
|
|
147
147
|
}
|
|
148
148
|
.mt-2 {
|
|
149
149
|
margin-top: 0.5rem;
|
|
@@ -163,12 +163,12 @@
|
|
|
163
163
|
.h-10 {
|
|
164
164
|
height: 2.5rem;
|
|
165
165
|
}
|
|
166
|
-
.h-48 {
|
|
167
|
-
height: 12rem;
|
|
168
|
-
}
|
|
169
166
|
.h-8 {
|
|
170
167
|
height: 2rem;
|
|
171
168
|
}
|
|
169
|
+
.h-96 {
|
|
170
|
+
height: 24rem;
|
|
171
|
+
}
|
|
172
172
|
.h-full {
|
|
173
173
|
height: 100%;
|
|
174
174
|
}
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/styles.css"],"sourcesContent":["*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: \n}\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: \n}\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0\n}\n.absolute {\n position: absolute\n}\n.relative {\n position: relative\n}\n.inset-0 {\n inset: 0px\n}\n.left-0 {\n left: 0px\n}\n.right-0 {\n right: 0px\n}\n.right-4 {\n right: 1rem\n}\n.top-0 {\n top: 0px\n}\n.top-4 {\n top: 1rem\n}\n.z-\\[9999\\] {\n z-index: 9999\n}\n.mt-2 {\n margin-top: 0.5rem\n}\n.block {\n display: block\n}\n.inline {\n display: inline\n}\n.flex {\n display: flex\n}\n.hidden {\n display: none\n}\n.h-10 {\n height: 2.5rem\n}\n.h-48 {\n height: 12rem\n}\n.h-8 {\n height: 2rem\n}\n.h-full {\n height: 100%\n}\n.h-screen {\n height: 100vh\n}\n.w-10 {\n width: 2.5rem\n}\n.w-8 {\n width: 2rem\n}\n.w-80 {\n width: 20rem\n}\n.w-full {\n width: 100%\n}\n.w-screen {\n width: 100vw\n}\n.shrink-0 {\n flex-shrink: 0\n}\n@keyframes spin {\n to {\n transform: rotate(360deg)\n }\n}\n.animate-spin {\n animation: spin 1s linear infinite\n}\n.cursor-pointer {\n cursor: pointer\n}\n.items-center {\n align-items: center\n}\n.justify-center {\n justify-content: center\n}\n.justify-between {\n justify-content: space-between\n}\n.gap-2 {\n gap: 0.5rem\n}\n.overflow-hidden {\n overflow: hidden\n}\n.rounded-3xl {\n border-radius: 1.5rem\n}\n.rounded-full {\n border-radius: 9999px\n}\n.rounded-lg {\n border-radius: 0.5rem\n}\n.border {\n border-width: 1px\n}\n.border-none {\n border-style: none\n}\n.border-neutral-500 {\n --tw-border-opacity: 1;\n border-color: rgb(115 115 115 / var(--tw-border-opacity))\n}\n.bg-neutral-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity))\n}\n.bg-neutral-950 {\n --tw-bg-opacity: 1;\n background-color: rgb(10 10 10 / var(--tw-bg-opacity))\n}\n.bg-transparent {\n background-color: transparent\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity))\n}\n.bg-opacity-50 {\n --tw-bg-opacity: 0.5\n}\n.fill-neutral-600 {\n fill: #525252\n}\n.object-cover {\n -o-object-fit: cover;\n object-fit: cover\n}\n.p-1 {\n padding: 0.25rem\n}\n.p-6 {\n padding: 1.5rem\n}\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem\n}\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem\n}\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem\n}\n.text-neutral-200 {\n --tw-text-opacity: 1;\n color: rgb(229 229 229 / var(--tw-text-opacity))\n}\n.text-neutral-400 {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity))\n}\n.text-neutral-500 {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity))\n}\n.shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)\n}\n.shadow-xl {\n --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)\n}\n.transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms\n}\n.hover\\:bg-neutral-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity))\n}\n.hover\\:bg-opacity-50:hover {\n --tw-bg-opacity: 0.5\n}\n@media (prefers-color-scheme: dark) {\n .dark\\:fill-neutral-300 {\n fill: #d4d4d4\n }\n .dark\\:text-neutral-600 {\n --tw-text-opacity: 1;\n color: rgb(82 82 82 / var(--tw-text-opacity))\n }\n}\n"],"mappings":";AAAA;AAAG;AAAU;AACT,yBAAuB;AACvB,yBAAuB;AACvB,oBAAkB;AAClB,oBAAkB;AAClB,eAAa;AACb,eAAa;AACb,eAAa;AACb,gBAAc;AACd,gBAAc;AACd;AACA;AACA;AACA,+BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAwB;AACxB,0BAAwB;AACxB,mBAAiB,IAAI,GAAG,IAAI,IAAI,EAAE;AAClC,2BAAyB,EAAE,EAAE;AAC7B,oBAAkB,EAAE,EAAE;AACtB,eAAa,EAAE,EAAE;AACjB,uBAAqB,EAAE,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACJ;AACA;AACI,yBAAuB;AACvB,yBAAuB;AACvB,oBAAkB;AAClB,oBAAkB;AAClB,eAAa;AACb,eAAa;AACb,eAAa;AACb,gBAAc;AACd,gBAAc;AACd;AACA;AACA;AACA,+BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAwB;AACxB,0BAAwB;AACxB,mBAAiB,IAAI,GAAG,IAAI,IAAI,EAAE;AAClC,2BAAyB,EAAE,EAAE;AAC7B,oBAAkB,EAAE,EAAE;AACtB,eAAa,EAAE,EAAE;AACjB,uBAAqB,EAAE,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACJ;AACA,CAAC;AACG,YAAU;AACV,SAAO;AACP,UAAQ;AACR,WAAS;AACT,UAAQ;AACR,YAAU;AACV,QAAM,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACpB,eAAa;AACb,gBAAc;AAClB;AACA,CAAC;AACG,YAAU;AACd;AACA,CAAC;AACG,YAAU;AACd;AACA,CAAC;AACG,SAAO;AACX;AACA,CAAC;AACG,QAAM;AACV;AACA,CAAC;AACG,SAAO;AACX;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AAAA,IAAE,IAAI,gBAAgB,EAAE,EAAE,EAAE,MAAM;AAAA,IAAE,IAAI;AAC/F;AACA,CAAC;AACG;AAAA,IAAqB,KAAK;AAAA,IAAE,gBAAgB;AAAA,IAAE,YAAY;AAAA,IAAE,qBAAqB;AAAA,IAAE,IAAI;AAAA,IAAE;AACzF,8BAA4B,aAAa,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;AACtD,uBAAqB;AACzB;AACA,CAAC,qBAAqB;AAClB,mBAAiB;AACjB,oBAAkB,IAAI,IAAI,IAAI,IAAI,EAAE,IAAI;AAC5C;AACA,CAAC,oBAAoB;AACjB,mBAAiB;AACrB;AACA,OAAO,CAAC,oBAAoB,EAAE;AAC1B,GAAC;AACG,UAAM;AACV;AACA,GAAC;AACG,uBAAmB;AACnB,WAAO,IAAI,GAAG,GAAG,GAAG,EAAE,IAAI;AAC9B;AACJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/styles.css"],"sourcesContent":["*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: \n}\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: \n}\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0\n}\n.absolute {\n position: absolute\n}\n.relative {\n position: relative\n}\n.inset-0 {\n inset: 0px\n}\n.left-0 {\n left: 0px\n}\n.right-0 {\n right: 0px\n}\n.right-4 {\n right: 1rem\n}\n.top-0 {\n top: 0px\n}\n.top-4 {\n top: 1rem\n}\n.z-50 {\n z-index: 50\n}\n.mt-2 {\n margin-top: 0.5rem\n}\n.block {\n display: block\n}\n.inline {\n display: inline\n}\n.flex {\n display: flex\n}\n.hidden {\n display: none\n}\n.h-10 {\n height: 2.5rem\n}\n.h-8 {\n height: 2rem\n}\n.h-96 {\n height: 24rem\n}\n.h-full {\n height: 100%\n}\n.h-screen {\n height: 100vh\n}\n.w-10 {\n width: 2.5rem\n}\n.w-8 {\n width: 2rem\n}\n.w-80 {\n width: 20rem\n}\n.w-full {\n width: 100%\n}\n.w-screen {\n width: 100vw\n}\n.shrink-0 {\n flex-shrink: 0\n}\n@keyframes spin {\n to {\n transform: rotate(360deg)\n }\n}\n.animate-spin {\n animation: spin 1s linear infinite\n}\n.cursor-pointer {\n cursor: pointer\n}\n.items-center {\n align-items: center\n}\n.justify-center {\n justify-content: center\n}\n.justify-between {\n justify-content: space-between\n}\n.gap-2 {\n gap: 0.5rem\n}\n.overflow-hidden {\n overflow: hidden\n}\n.rounded-3xl {\n border-radius: 1.5rem\n}\n.rounded-full {\n border-radius: 9999px\n}\n.rounded-lg {\n border-radius: 0.5rem\n}\n.border {\n border-width: 1px\n}\n.border-none {\n border-style: none\n}\n.border-neutral-500 {\n --tw-border-opacity: 1;\n border-color: rgb(115 115 115 / var(--tw-border-opacity))\n}\n.bg-neutral-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity))\n}\n.bg-neutral-950 {\n --tw-bg-opacity: 1;\n background-color: rgb(10 10 10 / var(--tw-bg-opacity))\n}\n.bg-transparent {\n background-color: transparent\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity))\n}\n.bg-opacity-50 {\n --tw-bg-opacity: 0.5\n}\n.fill-neutral-600 {\n fill: #525252\n}\n.object-cover {\n -o-object-fit: cover;\n object-fit: cover\n}\n.p-1 {\n padding: 0.25rem\n}\n.p-6 {\n padding: 1.5rem\n}\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem\n}\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem\n}\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem\n}\n.text-neutral-200 {\n --tw-text-opacity: 1;\n color: rgb(229 229 229 / var(--tw-text-opacity))\n}\n.text-neutral-400 {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity))\n}\n.text-neutral-500 {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity))\n}\n.shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)\n}\n.shadow-xl {\n --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)\n}\n.transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms\n}\n.hover\\:bg-neutral-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity))\n}\n.hover\\:bg-opacity-50:hover {\n --tw-bg-opacity: 0.5\n}\n@media (prefers-color-scheme: dark) {\n .dark\\:fill-neutral-300 {\n fill: #d4d4d4\n }\n .dark\\:text-neutral-600 {\n --tw-text-opacity: 1;\n color: rgb(82 82 82 / var(--tw-text-opacity))\n }\n}\n"],"mappings":";AAAA;AAAG;AAAU;AACT,yBAAuB;AACvB,yBAAuB;AACvB,oBAAkB;AAClB,oBAAkB;AAClB,eAAa;AACb,eAAa;AACb,eAAa;AACb,gBAAc;AACd,gBAAc;AACd;AACA;AACA;AACA,+BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAwB;AACxB,0BAAwB;AACxB,mBAAiB,IAAI,GAAG,IAAI,IAAI,EAAE;AAClC,2BAAyB,EAAE,EAAE;AAC7B,oBAAkB,EAAE,EAAE;AACtB,eAAa,EAAE,EAAE;AACjB,uBAAqB,EAAE,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACJ;AACA;AACI,yBAAuB;AACvB,yBAAuB;AACvB,oBAAkB;AAClB,oBAAkB;AAClB,eAAa;AACb,eAAa;AACb,eAAa;AACb,gBAAc;AACd,gBAAc;AACd;AACA;AACA;AACA,+BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAwB;AACxB,0BAAwB;AACxB,mBAAiB,IAAI,GAAG,IAAI,IAAI,EAAE;AAClC,2BAAyB,EAAE,EAAE;AAC7B,oBAAkB,EAAE,EAAE;AACtB,eAAa,EAAE,EAAE;AACjB,uBAAqB,EAAE,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACJ;AACA,CAAC;AACG,YAAU;AACV,SAAO;AACP,UAAQ;AACR,WAAS;AACT,UAAQ;AACR,YAAU;AACV,QAAM,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACpB,eAAa;AACb,gBAAc;AAClB;AACA,CAAC;AACG,YAAU;AACd;AACA,CAAC;AACG,YAAU;AACd;AACA,CAAC;AACG,SAAO;AACX;AACA,CAAC;AACG,QAAM;AACV;AACA,CAAC;AACG,SAAO;AACX;AACA,CAAC;AACG,SAAO;AACX;AACA,CAAC;AACG,OAAK;AACT;AACA,CAAC;AACG,OAAK;AACT;AACA,CAAC;AACG,WAAS;AACb;AACA,CAAC;AACG,cAAY;AAChB;AACA,CAAC;AACG,WAAS;AACb;AACA,CAAC;AACG,WAAS;AACb;AACA,CAAC;AACG,WAAS;AACb;AACA,CAAC;AACG,WAAS;AACb;AACA,CAAC;AACG,UAAQ;AACZ;AACA,CAAC;AACG,UAAQ;AACZ;AACA,CAAC;AACG,UAAQ;AACZ;AACA,CAAC;AACG,UAAQ;AACZ;AACA,CAAC;AACG,UAAQ;AACZ;AACA,CAAC;AACG,SAAO;AACX;AACA,CAAC;AACG,SAAO;AACX;AACA,CAAC;AACG,SAAO;AACX;AACA,CAAC;AACG,SAAO;AACX;AACA,CAAC;AACG,SAAO;AACX;AACA,CAAC;AACG,eAAa;AACjB;AACA,WAAW;AACP;AACI,eAAW,OAAO;AACtB;AACJ;AACA,CAAC;AACG,aAAW,KAAK,GAAG,OAAO;AAC9B;AACA,CAAC;AACG,UAAQ;AACZ;AACA,CAAC;AACG,eAAa;AACjB;AACA,CAAC;AACG,mBAAiB;AACrB;AACA,CAAC;AACG,mBAAiB;AACrB;AACA,CAAC;AACG,OAAK;AACT;AACA,CAAC;AACG,YAAU;AACd;AACA,CAAC;AACG,iBAAe;AACn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AI,uBAAuB,EAAE,EAAE,EAAE,MAAM;AAAA,IAAE,IAAI,gBAAgB,EAAE,EAAE,EAAE,MAAM;AAAA,IAAE,IAAI;AAC/F;AACA,CAAC;AACG,eAAa,EAAE,KAAK,KAAK,KAAK,IAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,KAAK,KAAK,IAAI,EAAE,EAAE,EAAE,EAAE;AAC5E,uBAAqB,EAAE,KAAK,KAAK,KAAK,IAAI,kBAAkB,EAAE,EAAE,IAAI,KAAK,KAAK,IAAI;AAClF;AAAA,IAAY,IAAI,uBAAuB,EAAE,EAAE,EAAE,MAAM;AAAA,IAAE,IAAI,gBAAgB,EAAE,EAAE,EAAE,MAAM;AAAA,IAAE,IAAI;AAC/F;AACA,CAAC;AACG;AAAA,IAAqB,KAAK;AAAA,IAAE,gBAAgB;AAAA,IAAE,YAAY;AAAA,IAAE,qBAAqB;AAAA,IAAE,IAAI;AAAA,IAAE;AACzF,8BAA4B,aAAa,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;AACtD,uBAAqB;AACzB;AACA,CAAC,qBAAqB;AAClB,mBAAiB;AACjB,oBAAkB,IAAI,IAAI,IAAI,IAAI,EAAE,IAAI;AAC5C;AACA,CAAC,oBAAoB;AACjB,mBAAiB;AACrB;AACA,OAAO,CAAC,oBAAoB,EAAE;AAC1B,GAAC;AACG,UAAM;AACV;AACA,GAAC;AACG,uBAAmB;AACnB,WAAO,IAAI,GAAG,GAAG,GAAG,EAAE,IAAI;AAC9B;AACJ;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as Config, D as DisplayMode, E as Endpoints, F as ForwardedTokens, T as Tokens,
|
|
2
|
-
import 'oslo/
|
|
1
|
+
export { C as Config, D as DisplayMode, E as Endpoints, F as ForwardedTokens, T as Tokens, a as User } from './index-DFVNodC9.mjs';
|
|
2
|
+
import 'oslo/oauth2';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as Config, D as DisplayMode, E as Endpoints, F as ForwardedTokens, T as Tokens,
|
|
2
|
-
import 'oslo/
|
|
1
|
+
export { C as Config, D as DisplayMode, E as Endpoints, F as ForwardedTokens, T as Tokens, a as User } from './index-DFVNodC9.js';
|
|
2
|
+
import 'oslo/oauth2';
|
package/dist/nextjs.d.mts
CHANGED
|
@@ -1,8 +1,239 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as next_dist_shared_lib_image_config from 'next/dist/shared/lib/image-config';
|
|
2
|
+
import * as next_dist_lib_load_custom_routes from 'next/dist/lib/load-custom-routes';
|
|
3
|
+
import * as next_dist_server_config_shared from 'next/dist/server/config-shared';
|
|
4
|
+
import { NextConfig } from 'next';
|
|
5
|
+
import { NextRequest, NextResponse } from 'next/server.js';
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
interface CookieConfig {
|
|
8
|
+
secure?: boolean;
|
|
9
|
+
sameSite?: "strict" | "lax" | "none";
|
|
10
|
+
domain?: string;
|
|
11
|
+
path?: string;
|
|
12
|
+
maxAge?: number;
|
|
13
|
+
}
|
|
14
|
+
type AuthConfigWithDefaults = {
|
|
15
|
+
clientId: string;
|
|
16
|
+
oauthServer: string;
|
|
17
|
+
callbackUrl: string;
|
|
4
18
|
loginUrl: string;
|
|
19
|
+
logoutUrl: string;
|
|
20
|
+
challengeUrl: string;
|
|
21
|
+
include: string[];
|
|
22
|
+
exclude: string[];
|
|
23
|
+
cookies: {
|
|
24
|
+
tokens: CookieConfig;
|
|
25
|
+
user: CookieConfig;
|
|
26
|
+
};
|
|
5
27
|
};
|
|
6
|
-
|
|
28
|
+
type AuthConfig = Partial<AuthConfigWithDefaults>;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a Next.js plugin that handles auth configuration.
|
|
31
|
+
*
|
|
32
|
+
* This is the main configuration point for the auth system.
|
|
33
|
+
* Do not set _civic_auth_* environment variables directly - instead,
|
|
34
|
+
* pass your configuration here:
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```js
|
|
38
|
+
* // next.config.js
|
|
39
|
+
* export tefault createCivicAuthPlugin({
|
|
40
|
+
* clientId: 'my-client-id',
|
|
41
|
+
* callbackUrl: '/custom/callback',
|
|
42
|
+
* loginUrl: '/custom/login',
|
|
43
|
+
* logoutUrl: '/custom/logout',
|
|
44
|
+
* include: ['/protected/*'],
|
|
45
|
+
* exclude: ['/public/*']
|
|
46
|
+
* })
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* The plugin sets internal environment variables that are used by
|
|
50
|
+
* the auth system. These variables should not be set manually.
|
|
51
|
+
*/
|
|
52
|
+
declare const createCivicAuthPlugin: (clientId: string, authConfig?: AuthConfig) => (nextConfig?: NextConfig) => {
|
|
53
|
+
env: {
|
|
54
|
+
_civic_auth_client_id: string;
|
|
55
|
+
_civic_oauth_server: string;
|
|
56
|
+
_civic_auth_callback_url: string;
|
|
57
|
+
_civic_auth_login_url: string;
|
|
58
|
+
_civic_auth_logout_url: string;
|
|
59
|
+
_civic_auth_includes: string;
|
|
60
|
+
_civic_auth_excludes: string;
|
|
61
|
+
_civic_auth_cookie_config: string;
|
|
62
|
+
};
|
|
63
|
+
exportPathMap?: (defaultMap: next_dist_server_config_shared.ExportPathMap, ctx: {
|
|
64
|
+
dev: boolean;
|
|
65
|
+
dir: string;
|
|
66
|
+
outDir: string | null;
|
|
67
|
+
distDir: string;
|
|
68
|
+
buildId: string;
|
|
69
|
+
}) => Promise<next_dist_server_config_shared.ExportPathMap> | next_dist_server_config_shared.ExportPathMap;
|
|
70
|
+
i18n?: next_dist_server_config_shared.I18NConfig | null;
|
|
71
|
+
eslint?: next_dist_server_config_shared.ESLintConfig;
|
|
72
|
+
typescript?: next_dist_server_config_shared.TypeScriptConfig;
|
|
73
|
+
headers?: () => Promise<next_dist_lib_load_custom_routes.Header[]>;
|
|
74
|
+
rewrites?: () => Promise<next_dist_lib_load_custom_routes.Rewrite[] | {
|
|
75
|
+
beforeFiles: next_dist_lib_load_custom_routes.Rewrite[];
|
|
76
|
+
afterFiles: next_dist_lib_load_custom_routes.Rewrite[];
|
|
77
|
+
fallback: next_dist_lib_load_custom_routes.Rewrite[];
|
|
78
|
+
}>;
|
|
79
|
+
redirects?: () => Promise<next_dist_lib_load_custom_routes.Redirect[]>;
|
|
80
|
+
excludeDefaultMomentLocales?: boolean;
|
|
81
|
+
webpack?: next_dist_server_config_shared.NextJsWebpackConfig | null;
|
|
82
|
+
trailingSlash?: boolean;
|
|
83
|
+
distDir?: string;
|
|
84
|
+
cleanDistDir?: boolean;
|
|
85
|
+
assetPrefix?: string;
|
|
86
|
+
cacheHandler?: string | undefined;
|
|
87
|
+
cacheMaxMemorySize?: number;
|
|
88
|
+
useFileSystemPublicRoutes?: boolean;
|
|
89
|
+
generateBuildId?: () => string | null | Promise<string | null>;
|
|
90
|
+
generateEtags?: boolean;
|
|
91
|
+
pageExtensions?: string[];
|
|
92
|
+
compress?: boolean;
|
|
93
|
+
analyticsId?: string;
|
|
94
|
+
poweredByHeader?: boolean;
|
|
95
|
+
images?: next_dist_shared_lib_image_config.ImageConfig;
|
|
96
|
+
devIndicators?: {
|
|
97
|
+
buildActivity?: boolean;
|
|
98
|
+
buildActivityPosition?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
99
|
+
};
|
|
100
|
+
onDemandEntries?: {
|
|
101
|
+
maxInactiveAge?: number;
|
|
102
|
+
pagesBufferLength?: number;
|
|
103
|
+
};
|
|
104
|
+
amp?: {
|
|
105
|
+
canonicalBase?: string;
|
|
106
|
+
};
|
|
107
|
+
deploymentId?: string;
|
|
108
|
+
basePath?: string;
|
|
109
|
+
sassOptions?: {
|
|
110
|
+
[key: string]: any;
|
|
111
|
+
};
|
|
112
|
+
productionBrowserSourceMaps?: boolean;
|
|
113
|
+
optimizeFonts?: boolean;
|
|
114
|
+
reactProductionProfiling?: boolean;
|
|
115
|
+
reactStrictMode?: boolean | null;
|
|
116
|
+
publicRuntimeConfig?: {
|
|
117
|
+
[key: string]: any;
|
|
118
|
+
};
|
|
119
|
+
serverRuntimeConfig?: {
|
|
120
|
+
[key: string]: any;
|
|
121
|
+
};
|
|
122
|
+
httpAgentOptions?: {
|
|
123
|
+
keepAlive?: boolean;
|
|
124
|
+
};
|
|
125
|
+
outputFileTracing?: boolean;
|
|
126
|
+
staticPageGenerationTimeout?: number;
|
|
127
|
+
crossOrigin?: "anonymous" | "use-credentials";
|
|
128
|
+
swcMinify?: boolean;
|
|
129
|
+
compiler?: {
|
|
130
|
+
reactRemoveProperties?: boolean | {
|
|
131
|
+
properties?: string[];
|
|
132
|
+
};
|
|
133
|
+
relay?: {
|
|
134
|
+
src: string;
|
|
135
|
+
artifactDirectory?: string;
|
|
136
|
+
language?: "typescript" | "javascript" | "flow";
|
|
137
|
+
eagerEsModules?: boolean;
|
|
138
|
+
};
|
|
139
|
+
removeConsole?: boolean | {
|
|
140
|
+
exclude?: string[];
|
|
141
|
+
};
|
|
142
|
+
styledComponents?: boolean | next_dist_server_config_shared.StyledComponentsConfig;
|
|
143
|
+
emotion?: boolean | next_dist_server_config_shared.EmotionConfig;
|
|
144
|
+
styledJsx?: boolean | {
|
|
145
|
+
useLightningcss?: boolean;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
output?: "standalone" | "export";
|
|
149
|
+
transpilePackages?: string[];
|
|
150
|
+
skipMiddlewareUrlNormalize?: boolean;
|
|
151
|
+
skipTrailingSlashRedirect?: boolean;
|
|
152
|
+
modularizeImports?: Record<string, {
|
|
153
|
+
transform: string | Record<string, string>;
|
|
154
|
+
preventFullImport?: boolean;
|
|
155
|
+
skipDefaultConversion?: boolean;
|
|
156
|
+
}>;
|
|
157
|
+
logging?: {
|
|
158
|
+
fetches?: {
|
|
159
|
+
fullUrl?: boolean;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
experimental?: next_dist_server_config_shared.ExperimentalConfig;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Creates an authentication handler for Next.js API routes
|
|
167
|
+
*
|
|
168
|
+
* Usage:
|
|
169
|
+
* ```ts
|
|
170
|
+
* // app/api/auth/[...civicauth]/route.ts
|
|
171
|
+
* import { handler } from '@civic/auth/nextjs'
|
|
172
|
+
* export const GET = handler({
|
|
173
|
+
* // optional config overrides
|
|
174
|
+
* })
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
declare function handler(authConfig?: AuthConfig): (request: NextRequest) => Promise<NextResponse>;
|
|
178
|
+
|
|
179
|
+
type UnknownObject = Record<string, unknown>;
|
|
180
|
+
type EmptyObject = Record<string, never>;
|
|
181
|
+
type ForwardedTokens = Record<string, {
|
|
182
|
+
idToken?: string;
|
|
183
|
+
accessToken?: string;
|
|
184
|
+
refreshToken?: string;
|
|
185
|
+
}>;
|
|
186
|
+
type Tokens = {
|
|
187
|
+
idToken: string;
|
|
188
|
+
accessToken: string;
|
|
189
|
+
refreshToken: string;
|
|
190
|
+
forwardedTokens: ForwardedTokens;
|
|
191
|
+
};
|
|
192
|
+
type BaseUser = {
|
|
193
|
+
id: string;
|
|
194
|
+
email?: string;
|
|
195
|
+
name?: string;
|
|
196
|
+
given_name?: string;
|
|
197
|
+
family_name?: string;
|
|
198
|
+
picture?: string;
|
|
199
|
+
updated_at?: Date;
|
|
200
|
+
};
|
|
201
|
+
type User<T extends UnknownObject = EmptyObject> = BaseUser & Tokens & T;
|
|
202
|
+
|
|
203
|
+
declare const getUser: () => User<UnknownObject> | null;
|
|
204
|
+
|
|
205
|
+
type Middleware = (request: NextRequest) => Promise<NextResponse> | NextResponse;
|
|
206
|
+
/**
|
|
207
|
+
*
|
|
208
|
+
* Use this when auth is the only middleware you need.
|
|
209
|
+
* Usage:
|
|
210
|
+
*
|
|
211
|
+
* export default authMiddleware({ loginUrl = '/login' }); // or just authMiddleware();
|
|
212
|
+
*
|
|
213
|
+
*/
|
|
214
|
+
declare const authMiddleware: (authConfig?: Omit<AuthConfigWithDefaults, "clientId">) => (request: NextRequest) => Promise<NextResponse>;
|
|
215
|
+
/**
|
|
216
|
+
* Usage:
|
|
217
|
+
*
|
|
218
|
+
* export default withAuth(async (request) => {
|
|
219
|
+
* console.log('my middleware');
|
|
220
|
+
* return NextResponse.next();
|
|
221
|
+
* })
|
|
222
|
+
*/
|
|
223
|
+
declare function withAuth(middleware: Middleware): (request: NextRequest) => Promise<NextResponse>;
|
|
224
|
+
/**
|
|
225
|
+
* Use this when you want to configure the middleware here (an alternative is to do it in the next.config file)
|
|
226
|
+
*
|
|
227
|
+
* Usage:
|
|
228
|
+
*
|
|
229
|
+
* const withAuth = auth({ loginUrl = '/login' }); // or just auth();
|
|
230
|
+
*
|
|
231
|
+
* export default withAuth(async (request) => {
|
|
232
|
+
* console.log('my middleware');
|
|
233
|
+
* return NextResponse.next();
|
|
234
|
+
* })
|
|
235
|
+
*
|
|
236
|
+
*/
|
|
237
|
+
declare function auth(authConfig?: AuthConfig): (middleware: Middleware) => ((request: NextRequest) => Promise<NextResponse>);
|
|
7
238
|
|
|
8
|
-
export {
|
|
239
|
+
export { auth, authMiddleware, createCivicAuthPlugin, getUser, handler, withAuth };
|