@solidxai/core-ui 0.1.9-beta.0 → 0.1.9-beta.10
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/components/auth/AuthLayout.d.ts.map +1 -1
- package/dist/components/auth/AuthLayout.js +16 -15
- package/dist/components/auth/AuthLayout.js.map +1 -1
- package/dist/components/auth/AuthLayout.tsx +3 -1
- package/dist/components/auth/ForgotPasswordThankYou.js +1 -1
- package/dist/components/auth/ForgotPasswordThankYou.js.map +1 -1
- package/dist/components/auth/ForgotPasswordThankYou.tsx +2 -2
- package/dist/components/auth/SolidForgotPassword.js +1 -1
- package/dist/components/auth/SolidForgotPassword.js.map +1 -1
- package/dist/components/auth/SolidForgotPassword.tsx +2 -2
- package/dist/components/auth/SolidInitialLoginOtp.js +8 -8
- package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.tsx +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.js +8 -8
- package/dist/components/auth/SolidInitiateRegisterOtp.js.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.tsx +1 -1
- package/dist/components/auth/SolidLogin.js +7 -8
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +1 -1
- package/dist/components/auth/SolidOTPVerify.d.ts +3 -0
- package/dist/components/auth/SolidOTPVerify.d.ts.map +1 -0
- package/dist/components/auth/SolidOTPVerify.js +67 -0
- package/dist/components/auth/SolidOTPVerify.js.map +1 -0
- package/dist/components/auth/SolidOTPVerify.tsx +133 -0
- package/dist/components/auth/SolidRegister.js +9 -9
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidRegister.tsx +2 -2
- package/dist/components/common/AuthBanner.js.map +1 -1
- package/dist/components/common/SocialMediaLogin.js +1 -1
- package/dist/components/common/SocialMediaLogin.js.map +1 -1
- package/dist/components/common/SocialMediaLogin.tsx +4 -4
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts +2 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts.map +1 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.js +50 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.js.map +1 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +70 -0
- package/dist/components/core/form/SolidFormActionHeader.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.js +5 -2
- package/dist/components/core/form/SolidFormActionHeader.js.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.tsx +6 -3
- package/dist/components/core/form/SolidFormFooter.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormFooter.js +14 -7
- package/dist/components/core/form/SolidFormFooter.js.map +1 -1
- package/dist/components/core/form/SolidFormFooter.tsx +14 -6
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +7 -3
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +5 -2
- package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.js +10 -1
- package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.tsx +13 -1
- package/dist/components/core/form/fields/SolidDecimalField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.js +7 -1
- package/dist/components/core/form/fields/SolidDecimalField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.tsx +10 -1
- package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.js +14 -2
- package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.tsx +20 -2
- package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.js +9 -1
- package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.tsx +12 -1
- package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.js +23 -3
- package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.tsx +32 -3
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +15 -2
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +20 -4
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +21 -3
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +30 -3
- package/dist/components/core/form/fields/SolidPasswordField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidPasswordField.js +2 -1
- package/dist/components/core/form/fields/SolidPasswordField.js.map +1 -1
- package/dist/components/core/form/fields/SolidPasswordField.tsx +13 -1
- package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.js +9 -1
- package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.tsx +12 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +4 -4
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +10 -4
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.d.ts.map +1 -1
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.js +14 -3
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.js.map +1 -1
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.tsx +20 -3
- package/dist/components/core/kanban/SolidManyToOneFilterElement.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.js.map +1 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +2 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js +2 -2
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +10 -21
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js +2 -2
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +10 -18
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js +6 -3
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +24 -30
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +2 -2
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +66 -2
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +67 -2
- package/dist/components/core/list/SolidListViewConfigure.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js +31 -2
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +34 -2
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.d.ts +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.js +7 -6
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.js.map +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.tsx +10 -9
- package/dist/components/core/list/widgets/SolidUserBlockedStatusListWidget.d.ts +3 -0
- package/dist/components/core/list/widgets/SolidUserBlockedStatusListWidget.d.ts.map +1 -0
- package/dist/components/core/list/widgets/SolidUserBlockedStatusListWidget.js +39 -0
- package/dist/components/core/list/widgets/SolidUserBlockedStatusListWidget.js.map +1 -0
- package/dist/components/core/list/widgets/SolidUserBlockedStatusListWidget.tsx +50 -0
- package/dist/components/core/tree/SolidTreeTable.d.ts +1 -1
- package/dist/components/core/tree/SolidTreeTable.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeTable.js +78 -78
- package/dist/components/core/tree/SolidTreeTable.js.map +1 -1
- package/dist/components/core/tree/SolidTreeTable.tsx +1 -10
- package/dist/components/core/users/CreateUser.css +27 -2
- package/dist/components/core/users/CreateUser.d.ts.map +1 -1
- package/dist/components/core/users/CreateUser.js +52 -24
- package/dist/components/core/users/CreateUser.js.map +1 -1
- package/dist/components/core/users/CreateUser.tsx +46 -33
- package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
- package/dist/components/layout/user-profile-menu.js +2 -1
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/components/layout/user-profile-menu.tsx +22 -27
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +3 -0
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +2 -0
- package/dist/nextAuth/authProviders.d.ts +4 -0
- package/dist/nextAuth/authProviders.d.ts.map +1 -0
- package/dist/nextAuth/authProviders.js +198 -0
- package/dist/nextAuth/authProviders.js.map +1 -0
- package/dist/nextAuth/authProviders.tsx +232 -0
- package/dist/nextAuth/handleLogout.d.ts +2 -0
- package/dist/nextAuth/handleLogout.d.ts.map +1 -0
- package/dist/nextAuth/handleLogout.js +36 -0
- package/dist/nextAuth/handleLogout.js.map +1 -0
- package/dist/nextAuth/handleLogout.tsx +39 -0
- package/dist/nextAuth/refreshAccessToken.d.ts +2 -0
- package/dist/nextAuth/refreshAccessToken.d.ts.map +1 -0
- package/dist/nextAuth/refreshAccessToken.js +24 -0
- package/dist/nextAuth/refreshAccessToken.js.map +1 -0
- package/dist/nextAuth/refreshAccessToken.tsx +28 -0
- package/dist/redux/features/settingsSlice.d.ts +20 -0
- package/dist/redux/features/settingsSlice.d.ts.map +1 -0
- package/dist/redux/features/settingsSlice.js +39 -0
- package/dist/redux/features/settingsSlice.js.map +1 -0
- package/dist/redux/features/settingsSlice.ts +60 -0
- package/dist/resources/globals.css +7 -1
- package/dist/resources/shadcn-base.css +25 -9
- package/dist/routes/SolidRouteMetadataBoundary.d.ts +5 -0
- package/dist/routes/SolidRouteMetadataBoundary.d.ts.map +1 -0
- package/dist/routes/SolidRouteMetadataBoundary.js +72 -0
- package/dist/routes/SolidRouteMetadataBoundary.js.map +1 -0
- package/dist/routes/SolidRouteMetadataBoundary.tsx +77 -0
- package/dist/routes/pages/studio/StudioLandingPage.d.ts.map +1 -1
- package/dist/routes/pages/studio/StudioLandingPage.js +35 -7
- package/dist/routes/pages/studio/StudioLandingPage.js.map +1 -1
- package/dist/routes/pages/studio/StudioLandingPage.tsx +42 -6
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +47 -26
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +47 -26
- package/dist/routes/types.d.ts +7 -0
- package/dist/routes/types.d.ts.map +1 -1
- package/dist/routes/types.js.map +1 -1
- package/dist/routes/types.ts +8 -0
- package/package.json +1 -1
- package/dist/components/core/list/SolidDataTablePagination.d.ts +0 -15
- package/dist/components/core/list/SolidDataTablePagination.d.ts.map +0 -1
- package/dist/components/core/list/SolidDataTablePagination.js +0 -22
- package/dist/components/core/list/SolidDataTablePagination.js.map +0 -1
- package/dist/components/core/list/SolidDataTablePagination.tsx +0 -71
- package/dist/components/solid-ui/SolidButton.d.ts +0 -14
- package/dist/components/solid-ui/SolidButton.d.ts.map +0 -1
- package/dist/components/solid-ui/SolidButton.js +0 -36
- package/dist/components/solid-ui/SolidButton.js.map +0 -1
- package/dist/components/solid-ui/SolidButton.tsx +0 -54
- package/dist/components/solid-ui/SolidTabs.d.ts +0 -18
- package/dist/components/solid-ui/SolidTabs.d.ts.map +0 -1
- package/dist/components/solid-ui/SolidTabs.js +0 -22
- package/dist/components/solid-ui/SolidTabs.js.map +0 -1
- package/dist/components/solid-ui/SolidTabs.tsx +0 -73
- package/dist/components/solid-ui/index.d.ts +0 -3
- package/dist/components/solid-ui/index.d.ts.map +0 -1
- package/dist/components/solid-ui/index.js +0 -3
- package/dist/components/solid-ui/index.js.map +0 -1
- package/dist/components/solid-ui/index.ts +0 -2
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import CredentialsProvider from "next-auth/providers/credentials";
|
|
2
|
+
import GoogleProvider from "next-auth/providers/google";
|
|
3
|
+
import { NextRequest } from "next/server";
|
|
4
|
+
import { jwtDecode } from "jwt-decode";
|
|
5
|
+
import { JWT } from "next-auth/jwt";
|
|
6
|
+
import axios from "axios";
|
|
7
|
+
import { signOut } from "next-auth/react";
|
|
8
|
+
import { refreshAccessToken } from "./refreshAccessToken";
|
|
9
|
+
import { NextAuthOptions } from "next-auth";
|
|
10
|
+
|
|
11
|
+
type Credentials = {
|
|
12
|
+
username: string,
|
|
13
|
+
email: string,
|
|
14
|
+
password: string,
|
|
15
|
+
identifier:string,
|
|
16
|
+
accessToken: string,
|
|
17
|
+
accessCode: string,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const authProviders: NextAuthOptions = {
|
|
21
|
+
session: {
|
|
22
|
+
strategy: "jwt",
|
|
23
|
+
},
|
|
24
|
+
providers: [
|
|
25
|
+
GoogleProvider({
|
|
26
|
+
clientId: process.env.GOOGLE_ID!,
|
|
27
|
+
clientSecret: process.env.GOOGLE_CLIENT_SECRET!
|
|
28
|
+
}),
|
|
29
|
+
CredentialsProvider({
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
async authorize(credentials: Credentials, req: any) {
|
|
32
|
+
const userAgent = req.headers['user-agent'];
|
|
33
|
+
|
|
34
|
+
const { username, email, password, identifier, accessToken, accessCode } = credentials;
|
|
35
|
+
try {
|
|
36
|
+
if (accessCode) {
|
|
37
|
+
let config = {
|
|
38
|
+
method: 'get',
|
|
39
|
+
url: `${process.env.API_URL}/api/iam/google/authenticate?accessCode=${accessCode}`,
|
|
40
|
+
headers: {
|
|
41
|
+
'User-Agent': userAgent,
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const loginResponse = await axios.request(config);
|
|
45
|
+
if (loginResponse.status == 400) {
|
|
46
|
+
throw new Error(loginResponse.data.message);
|
|
47
|
+
}
|
|
48
|
+
if (loginResponse.status == 401) {
|
|
49
|
+
throw new Error(loginResponse.data.message);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let base64decoded = jwtDecode(loginResponse.data.data.accessToken);
|
|
53
|
+
// let accessTokenExpires = base64decoded.exp;
|
|
54
|
+
let accessTokenExpires = base64decoded.exp && base64decoded.exp * 1000;
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
accessToken: loginResponse.data.data.accessToken,
|
|
58
|
+
refreshToken: loginResponse.data.data.refreshToken,
|
|
59
|
+
accessTokenExpires: accessTokenExpires,
|
|
60
|
+
...loginResponse.data.data,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
} else {
|
|
64
|
+
if (accessToken) {
|
|
65
|
+
let data = JSON.stringify({
|
|
66
|
+
username: identifier,
|
|
67
|
+
email: identifier.includes('@')? identifier : null,
|
|
68
|
+
password: password
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
let config = {
|
|
72
|
+
method: 'get',
|
|
73
|
+
url: `${process.env.API_URL}/api/iam/me`,
|
|
74
|
+
headers: {
|
|
75
|
+
'accept': '*/*',
|
|
76
|
+
'Content-Type': 'application/json',
|
|
77
|
+
'Authorization': `Bearer ${accessToken}`
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
const loginResponse = await axios.request(config);
|
|
83
|
+
|
|
84
|
+
if (loginResponse.status == 400) {
|
|
85
|
+
throw new Error(loginResponse.data.message);
|
|
86
|
+
}
|
|
87
|
+
if (loginResponse.status == 401) {
|
|
88
|
+
throw new Error(loginResponse.data.message);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let base64decoded = jwtDecode(accessToken);
|
|
92
|
+
// let accessTokenExpires = base64decoded.exp;
|
|
93
|
+
let accessTokenExpires = base64decoded.exp && base64decoded.exp * 1000;
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
accessToken: accessToken,
|
|
97
|
+
refreshToken: loginResponse.data.data.refreshToken,
|
|
98
|
+
accessTokenExpires: accessTokenExpires,
|
|
99
|
+
...loginResponse.data.data,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
} else {
|
|
103
|
+
|
|
104
|
+
let data = JSON.stringify({
|
|
105
|
+
username: identifier,
|
|
106
|
+
email: identifier.includes('@')? identifier : null,
|
|
107
|
+
password: password
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
let config = {
|
|
111
|
+
method: 'post',
|
|
112
|
+
maxBodyLength: Infinity,
|
|
113
|
+
url: `${process.env.API_URL}/api/iam/authenticate`,
|
|
114
|
+
headers: {
|
|
115
|
+
'accept': '*/*',
|
|
116
|
+
'Content-Type': 'application/json',
|
|
117
|
+
'User-Agent': userAgent,
|
|
118
|
+
},
|
|
119
|
+
data: data
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
const loginResponse = await axios.request(config);
|
|
124
|
+
|
|
125
|
+
// const authenticateResponse = await fetch(
|
|
126
|
+
// `${process.env.API_URL}/api/iam/authenticate`,
|
|
127
|
+
// {
|
|
128
|
+
// method: "Post",
|
|
129
|
+
// headers: {
|
|
130
|
+
// 'accept': '*/*',
|
|
131
|
+
// "Content-Type": "application/json"
|
|
132
|
+
// },
|
|
133
|
+
// body: JSON.stringify({
|
|
134
|
+
// username: email,
|
|
135
|
+
// email: email,
|
|
136
|
+
// password: password
|
|
137
|
+
// })
|
|
138
|
+
// }
|
|
139
|
+
// );
|
|
140
|
+
|
|
141
|
+
// const loginResponse = await authenticateResponse.json();
|
|
142
|
+
|
|
143
|
+
// const response = await fetch(
|
|
144
|
+
// `${process.env.API_URL}/api/iam/me`,
|
|
145
|
+
// {
|
|
146
|
+
// method: "Get",
|
|
147
|
+
// headers: {
|
|
148
|
+
// "Content-Type": "application/json",
|
|
149
|
+
// "Authorization": `Bearer ${loginResponse.data.accessToken}`,
|
|
150
|
+
// },
|
|
151
|
+
// }
|
|
152
|
+
// );
|
|
153
|
+
|
|
154
|
+
// const responseData = await response.json();
|
|
155
|
+
|
|
156
|
+
if (loginResponse.status == 400) {
|
|
157
|
+
throw new Error(loginResponse.data.message);
|
|
158
|
+
}
|
|
159
|
+
if (loginResponse.status == 401) {
|
|
160
|
+
throw new Error(loginResponse.data.data.message);
|
|
161
|
+
}
|
|
162
|
+
let base64decoded = jwtDecode(loginResponse.data.data.accessToken);
|
|
163
|
+
// let accessTokenExpires = base64decoded.exp;
|
|
164
|
+
let accessTokenExpires = base64decoded.exp && base64decoded.exp * 1000;
|
|
165
|
+
const returnResponse = {
|
|
166
|
+
accessToken: loginResponse.data.data.accessToken,
|
|
167
|
+
refreshToken: loginResponse.data.data.refreshToken,
|
|
168
|
+
accessTokenExpires: accessTokenExpires,
|
|
169
|
+
...loginResponse.data.data,
|
|
170
|
+
}
|
|
171
|
+
return returnResponse;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
} catch (error: any) {
|
|
175
|
+
throw new Error(error?.response?.data?.message);
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
}),
|
|
179
|
+
],
|
|
180
|
+
callbacks: {
|
|
181
|
+
// @ts-ignore
|
|
182
|
+
jwt: async ({ token, user }) => {
|
|
183
|
+
// console.log("JWT callback called");
|
|
184
|
+
const bufferTime = 60000;
|
|
185
|
+
if (Date.now() >= (token.accessTokenExpires as number - bufferTime)) {
|
|
186
|
+
// Call the refresh token function
|
|
187
|
+
return await refreshAccessToken(token);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// If there is no user (first time login or session), we return the user data
|
|
191
|
+
if (user) {
|
|
192
|
+
// const base64decoded = jwtDecode(user.accessToken);
|
|
193
|
+
// Convert from seconds to milliseconds
|
|
194
|
+
// const accessTokenExpires = base64decoded.exp && base64decoded.exp * 1000;
|
|
195
|
+
// const accessTokenExpires = user.accessTokenExpires * 1000;
|
|
196
|
+
return {
|
|
197
|
+
...token,
|
|
198
|
+
accessToken: user.accessToken,
|
|
199
|
+
refreshToken: user.refreshToken,
|
|
200
|
+
accessTokenExpires: user.accessTokenExpires,
|
|
201
|
+
user: user, // Include the user data here
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return token; // If no update needed, just return the existing token
|
|
206
|
+
},
|
|
207
|
+
// @ts-ignore
|
|
208
|
+
session: async ({ session, token }) => {
|
|
209
|
+
// console.log("Session callback called");
|
|
210
|
+
|
|
211
|
+
const user = token.user || {}; // Default to an empty object if user is undefined or null
|
|
212
|
+
session.error = token.error ? token.error : null;
|
|
213
|
+
// if (token.error) {
|
|
214
|
+
// return null
|
|
215
|
+
// }
|
|
216
|
+
session.user = {
|
|
217
|
+
...user, // Include the user info from the token
|
|
218
|
+
accessToken: token?.accessToken, // Add the access token to session for client use
|
|
219
|
+
refreshToken: token?.refreshToken, // Add refresh token to session for future use
|
|
220
|
+
accessTokenExpires: token?.accessTokenExpires && token?.accessTokenExpires, // Store the expiry time
|
|
221
|
+
};
|
|
222
|
+
return session;
|
|
223
|
+
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
pages: {
|
|
227
|
+
signIn: "/auth/login",
|
|
228
|
+
},
|
|
229
|
+
secret: process.env.NEXTAUTH_SECRET,
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export default authProviders
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleLogout.d.ts","sourceRoot":"./","sources":["nextAuth/handleLogout.tsx"],"names":[],"mappings":"AAIA,wBAAsB,YAAY,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,iBAkChD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ERROR_MESSAGES } from '../constants/error-messages';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import { getSession, signOut } from 'next-auth/react';
|
|
4
|
+
export async function handleLogout({ toast }) {
|
|
5
|
+
const session = await getSession();
|
|
6
|
+
// const token = session?.user?.accessToken;
|
|
7
|
+
const refreshToken = session?.user?.refreshToken;
|
|
8
|
+
try {
|
|
9
|
+
const response = await axios.post(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/iam/logout`, {
|
|
10
|
+
refreshToken: refreshToken, // Pass refresh token in body
|
|
11
|
+
});
|
|
12
|
+
console.log("logout response", response);
|
|
13
|
+
if (response?.data?.statusCode === 200) {
|
|
14
|
+
await signOut({ callbackUrl: '/auth/login' });
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
toast?.current?.show({
|
|
18
|
+
severity: 'error',
|
|
19
|
+
summary: ERROR_MESSAGES.LOGOUT_FAILED,
|
|
20
|
+
detail: `${response?.data?.data?.status}`,
|
|
21
|
+
life: 3000,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
const err = error;
|
|
27
|
+
const message = err.response?.data?.data?.message || err.message || ERROR_MESSAGES.LOGOUT_FAILED;
|
|
28
|
+
toast?.current?.show({
|
|
29
|
+
severity: 'error',
|
|
30
|
+
summary: ERROR_MESSAGES.LOGOUT_FAILED,
|
|
31
|
+
detail: message,
|
|
32
|
+
life: 3000,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=handleLogout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleLogout.js","sourceRoot":"./","sources":["nextAuth/handleLogout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAE,KAAK,EAAO;IAC7C,MAAM,OAAO,GAAG,MAAM,UAAU,EAAE,CAAC;IACnC,4CAA4C;IAC5C,MAAM,YAAY,GAAG,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC;IACjD,IAAI;QACA,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,iBAAiB,EAC7F;YACI,YAAY,EAAE,YAAY,EAAE,6BAA6B;SAC5D,CACA,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;QAEzC,IAAI,QAAQ,EAAE,IAAI,EAAE,UAAU,KAAK,GAAG,EAAE;YACpC,MAAM,OAAO,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,CAAC;SACjD;aAAM;YACH,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC;gBACjB,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE,cAAc,CAAC,aAAa;gBACrC,MAAM,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE;gBACzC,IAAI,EAAE,IAAI;aACb,CAAC,CAAC;SACN;KACJ;IAAC,OAAO,KAAK,EAAE;QACZ,MAAM,GAAG,GAAG,KAAY,CAAC;QACzB,MAAM,OAAO,GACT,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,IAAI,GAAG,CAAC,OAAO,IAAI,cAAc,CAAC,aAAa,CAAC;QAErF,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC;YACjB,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,cAAc,CAAC,aAAa;YACrC,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,IAAI;SACb,CAAC,CAAC;KACN;AACL,CAAC","sourcesContent":["import { ERROR_MESSAGES } from '../constants/error-messages';\nimport axios, { AxiosError } from 'axios';\nimport { getSession, signOut } from 'next-auth/react';\n\nexport async function handleLogout({ toast }: any) {\n const session = await getSession();\n // const token = session?.user?.accessToken;\n const refreshToken = session?.user?.refreshToken; \n try {\n const response = await axios.post(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/iam/logout`, \n {\n refreshToken: refreshToken, // Pass refresh token in body\n }\n );\n console.log(\"logout response\", response);\n\n if (response?.data?.statusCode === 200) {\n await signOut({ callbackUrl: '/auth/login' });\n } else {\n toast?.current?.show({\n severity: 'error',\n summary: ERROR_MESSAGES.LOGOUT_FAILED,\n detail: `${response?.data?.data?.status}`,\n life: 3000,\n });\n }\n } catch (error) {\n const err = error as any;\n const message =\n err.response?.data?.data?.message || err.message || ERROR_MESSAGES.LOGOUT_FAILED;\n\n toast?.current?.show({\n severity: 'error',\n summary: ERROR_MESSAGES.LOGOUT_FAILED,\n detail: message,\n life: 3000,\n });\n }\n}"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ERROR_MESSAGES } from '../constants/error-messages';
|
|
2
|
+
import axios, { AxiosError } from 'axios';
|
|
3
|
+
import { getSession, signOut } from 'next-auth/react';
|
|
4
|
+
|
|
5
|
+
export async function handleLogout({ toast }: any) {
|
|
6
|
+
const session = await getSession();
|
|
7
|
+
// const token = session?.user?.accessToken;
|
|
8
|
+
const refreshToken = session?.user?.refreshToken;
|
|
9
|
+
try {
|
|
10
|
+
const response = await axios.post(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/iam/logout`,
|
|
11
|
+
{
|
|
12
|
+
refreshToken: refreshToken, // Pass refresh token in body
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
console.log("logout response", response);
|
|
16
|
+
|
|
17
|
+
if (response?.data?.statusCode === 200) {
|
|
18
|
+
await signOut({ callbackUrl: '/auth/login' });
|
|
19
|
+
} else {
|
|
20
|
+
toast?.current?.show({
|
|
21
|
+
severity: 'error',
|
|
22
|
+
summary: ERROR_MESSAGES.LOGOUT_FAILED,
|
|
23
|
+
detail: `${response?.data?.data?.status}`,
|
|
24
|
+
life: 3000,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
} catch (error) {
|
|
28
|
+
const err = error as any;
|
|
29
|
+
const message =
|
|
30
|
+
err.response?.data?.data?.message || err.message || ERROR_MESSAGES.LOGOUT_FAILED;
|
|
31
|
+
|
|
32
|
+
toast?.current?.show({
|
|
33
|
+
severity: 'error',
|
|
34
|
+
summary: ERROR_MESSAGES.LOGOUT_FAILED,
|
|
35
|
+
detail: message,
|
|
36
|
+
life: 3000,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshAccessToken.d.ts","sourceRoot":"./","sources":["nextAuth/refreshAccessToken.tsx"],"names":[],"mappings":"AAIA,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,GAAG,gBAuBhD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ERROR_MESSAGES } from "../constants/error-messages";
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
import { jwtDecode } from "jwt-decode";
|
|
4
|
+
export async function refreshAccessToken(token) {
|
|
5
|
+
try {
|
|
6
|
+
const response = await axios.post(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/iam/refresh-tokens`, { refreshToken: token.refreshToken });
|
|
7
|
+
const { accessToken, refreshToken } = response.data.data;
|
|
8
|
+
const { exp: accessTokenExpires } = jwtDecode(accessToken);
|
|
9
|
+
return {
|
|
10
|
+
...token,
|
|
11
|
+
accessToken,
|
|
12
|
+
refreshToken,
|
|
13
|
+
accessTokenExpires: accessTokenExpires * 1000, // Convert seconds to milliseconds
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
console.error(ERROR_MESSAGES.FAILED_REFRESH_TOKEN, error.message || error.response?.data);
|
|
18
|
+
return {
|
|
19
|
+
// ...token,
|
|
20
|
+
error: "RefreshAccessTokenError",
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=refreshAccessToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshAccessToken.js","sourceRoot":"./","sources":["nextAuth/refreshAccessToken.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,KAAU;IAC/C,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAC/B,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,yBAAyB,EACnE,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CACrC,CAAC;QAEF,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QACzD,MAAM,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAAkB,WAAW,CAAC,CAAC;QAE5E,OAAO;YACL,GAAG,KAAK;YACR,WAAW;YACX,YAAY;YACZ,kBAAkB,EAAE,kBAAkB,GAAG,IAAI,EAAE,kCAAkC;SAClF,CAAC;KACH;IAAC,OAAO,KAAU,EAAE;QACnB,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,oBAAoB,EAAE,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC1F,OAAO;YACL,YAAY;YACZ,KAAK,EAAE,yBAAyB;SACjC,CAAC;KACH;AACH,CAAC","sourcesContent":["import { ERROR_MESSAGES } from \"../constants/error-messages\";\nimport axios from \"axios\";\nimport { jwtDecode } from \"jwt-decode\";\n\nexport async function refreshAccessToken(token: any) {\n try {\n const response = await axios.post(\n `${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/iam/refresh-tokens`,\n { refreshToken: token.refreshToken }\n );\n \n const { accessToken, refreshToken } = response.data.data;\n const { exp: accessTokenExpires } = jwtDecode<{ exp: number }>(accessToken);\n \n return {\n ...token,\n accessToken,\n refreshToken,\n accessTokenExpires: accessTokenExpires * 1000, // Convert seconds to milliseconds\n };\n } catch (error: any) {\n console.error(ERROR_MESSAGES.FAILED_REFRESH_TOKEN, error.message || error.response?.data);\n return {\n // ...token,\n error: \"RefreshAccessTokenError\",\n };\n }\n }"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ERROR_MESSAGES } from "../constants/error-messages";
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
import { jwtDecode } from "jwt-decode";
|
|
4
|
+
|
|
5
|
+
export async function refreshAccessToken(token: any) {
|
|
6
|
+
try {
|
|
7
|
+
const response = await axios.post(
|
|
8
|
+
`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/iam/refresh-tokens`,
|
|
9
|
+
{ refreshToken: token.refreshToken }
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
const { accessToken, refreshToken } = response.data.data;
|
|
13
|
+
const { exp: accessTokenExpires } = jwtDecode<{ exp: number }>(accessToken);
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
...token,
|
|
17
|
+
accessToken,
|
|
18
|
+
refreshToken,
|
|
19
|
+
accessTokenExpires: accessTokenExpires * 1000, // Convert seconds to milliseconds
|
|
20
|
+
};
|
|
21
|
+
} catch (error: any) {
|
|
22
|
+
console.error(ERROR_MESSAGES.FAILED_REFRESH_TOKEN, error.message || error.response?.data);
|
|
23
|
+
return {
|
|
24
|
+
// ...token,
|
|
25
|
+
error: "RefreshAccessTokenError",
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
export interface ISettingsState {
|
|
3
|
+
authSettings: Record<string, any>;
|
|
4
|
+
solidSettings: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
export declare const settingsSlice: import("@reduxjs/toolkit").Slice<ISettingsState, {
|
|
7
|
+
setSolidSettings: (state: import("immer/dist/internal.js").WritableDraft<ISettingsState>, action: PayloadAction<Record<string, any>>) => void;
|
|
8
|
+
updateSolidSetting: (state: import("immer/dist/internal.js").WritableDraft<ISettingsState>, action: PayloadAction<{
|
|
9
|
+
key: string;
|
|
10
|
+
value: any;
|
|
11
|
+
}>) => void;
|
|
12
|
+
resetSettings: () => ISettingsState;
|
|
13
|
+
}, "settingsSlice">;
|
|
14
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<ISettingsState>;
|
|
15
|
+
export default _default;
|
|
16
|
+
export declare const setSolidSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<Record<string, any>, "settingsSlice/setSolidSettings">, updateSolidSetting: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
17
|
+
key: string;
|
|
18
|
+
value: any;
|
|
19
|
+
}, "settingsSlice/updateSolidSetting">, resetSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settingsSlice/resetSettings">;
|
|
20
|
+
//# sourceMappingURL=settingsSlice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsSlice.d.ts","sourceRoot":"./","sources":["redux/features/settingsSlice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,kBAAkB,CAAC;AAE9D,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACpC;AAOD,eAAO,MAAM,aAAa;sGAsBZ,cAAc,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;wGAOlC,cAAc;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC;;mBAQtD,CAAC;;AAEH,wBAAqC;AAErC,eAAO,MAGL,gBAAgB,8GAChB,kBAAkB;SAhBe,MAAM;WAAS,GAAG;wCAiBnD,aAAa,uFACU,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2
|
+
const initialState = {
|
|
3
|
+
authSettings: {},
|
|
4
|
+
solidSettings: {},
|
|
5
|
+
};
|
|
6
|
+
export const settingsSlice = createSlice({
|
|
7
|
+
name: "settingsSlice",
|
|
8
|
+
initialState,
|
|
9
|
+
reducers: {
|
|
10
|
+
// // -------- AUTH SETTINGS --------
|
|
11
|
+
// setAuthSettings: (
|
|
12
|
+
// state,
|
|
13
|
+
// action: PayloadAction<Record<string, any>>
|
|
14
|
+
// ) => {
|
|
15
|
+
// state.authSettings = action.payload;
|
|
16
|
+
// },
|
|
17
|
+
// updateAuthSetting: (
|
|
18
|
+
// state,
|
|
19
|
+
// action: PayloadAction<{ key: string; value: any }>
|
|
20
|
+
// ) => {
|
|
21
|
+
// state.authSettings[action.payload.key] = action.payload.value;
|
|
22
|
+
// },
|
|
23
|
+
// -------- SOLID SETTINGS --------
|
|
24
|
+
setSolidSettings: (state, action) => {
|
|
25
|
+
state.solidSettings = action.payload;
|
|
26
|
+
},
|
|
27
|
+
updateSolidSetting: (state, action) => {
|
|
28
|
+
state.solidSettings[action.payload.key] = action.payload.value;
|
|
29
|
+
},
|
|
30
|
+
// -------- RESET --------
|
|
31
|
+
resetSettings: () => initialState,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
export default settingsSlice.reducer;
|
|
35
|
+
export const {
|
|
36
|
+
// setAuthSettings,
|
|
37
|
+
// updateAuthSetting,
|
|
38
|
+
setSolidSettings, updateSolidSetting, resetSettings, } = settingsSlice.actions;
|
|
39
|
+
//# sourceMappingURL=settingsSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsSlice.js","sourceRoot":"./","sources":["redux/features/settingsSlice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAO9D,MAAM,YAAY,GAAmB;IACnC,YAAY,EAAE,EAAE;IAChB,aAAa,EAAE,EAAE;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;IACvC,IAAI,EAAE,eAAe;IACrB,YAAY;IACZ,QAAQ,EAAE;QACR,qCAAqC;QACrC,qBAAqB;QACrB,WAAW;QACX,+CAA+C;QAC/C,SAAS;QACT,yCAAyC;QACzC,KAAK;QAEL,uBAAuB;QACvB,WAAW;QACX,uDAAuD;QACvD,SAAS;QACT,mEAAmE;QACnE,KAAK;QAEL,mCAAmC;QACnC,gBAAgB,EAAE,CAChB,KAAK,EACL,MAA0C,EAC1C,EAAE;YACF,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC;QACvC,CAAC;QAED,kBAAkB,EAAE,CAClB,KAAK,EACL,MAAkD,EAClD,EAAE;YACF,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QACjE,CAAC;QAED,0BAA0B;QAC1B,aAAa,EAAE,GAAG,EAAE,CAAC,YAAY;KAClC;CACF,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC,OAAO,CAAC;AAErC,MAAM,CAAC,MAAM;AACX,mBAAmB;AACnB,qBAAqB;AACrB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,GACd,GAAG,aAAa,CAAC,OAAO,CAAC","sourcesContent":["import { PayloadAction, createSlice } from \"@reduxjs/toolkit\";\n\nexport interface ISettingsState {\n authSettings: Record<string, any>;\n solidSettings: Record<string, any>;\n}\n\nconst initialState: ISettingsState = {\n authSettings: {},\n solidSettings: {},\n};\n\nexport const settingsSlice = createSlice({\n name: \"settingsSlice\",\n initialState,\n reducers: {\n // // -------- AUTH SETTINGS --------\n // setAuthSettings: (\n // state,\n // action: PayloadAction<Record<string, any>>\n // ) => {\n // state.authSettings = action.payload;\n // },\n\n // updateAuthSetting: (\n // state,\n // action: PayloadAction<{ key: string; value: any }>\n // ) => {\n // state.authSettings[action.payload.key] = action.payload.value;\n // },\n\n // -------- SOLID SETTINGS --------\n setSolidSettings: (\n state,\n action: PayloadAction<Record<string, any>>\n ) => {\n state.solidSettings = action.payload;\n },\n\n updateSolidSetting: (\n state,\n action: PayloadAction<{ key: string; value: any }>\n ) => {\n state.solidSettings[action.payload.key] = action.payload.value;\n },\n\n // -------- RESET --------\n resetSettings: () => initialState,\n },\n});\n\nexport default settingsSlice.reducer;\n\nexport const {\n // setAuthSettings,\n // updateAuthSetting,\n setSolidSettings,\n updateSolidSetting,\n resetSettings,\n} = settingsSlice.actions;\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
|
|
2
|
+
|
|
3
|
+
export interface ISettingsState {
|
|
4
|
+
authSettings: Record<string, any>;
|
|
5
|
+
solidSettings: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const initialState: ISettingsState = {
|
|
9
|
+
authSettings: {},
|
|
10
|
+
solidSettings: {},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const settingsSlice = createSlice({
|
|
14
|
+
name: "settingsSlice",
|
|
15
|
+
initialState,
|
|
16
|
+
reducers: {
|
|
17
|
+
// // -------- AUTH SETTINGS --------
|
|
18
|
+
// setAuthSettings: (
|
|
19
|
+
// state,
|
|
20
|
+
// action: PayloadAction<Record<string, any>>
|
|
21
|
+
// ) => {
|
|
22
|
+
// state.authSettings = action.payload;
|
|
23
|
+
// },
|
|
24
|
+
|
|
25
|
+
// updateAuthSetting: (
|
|
26
|
+
// state,
|
|
27
|
+
// action: PayloadAction<{ key: string; value: any }>
|
|
28
|
+
// ) => {
|
|
29
|
+
// state.authSettings[action.payload.key] = action.payload.value;
|
|
30
|
+
// },
|
|
31
|
+
|
|
32
|
+
// -------- SOLID SETTINGS --------
|
|
33
|
+
setSolidSettings: (
|
|
34
|
+
state,
|
|
35
|
+
action: PayloadAction<Record<string, any>>
|
|
36
|
+
) => {
|
|
37
|
+
state.solidSettings = action.payload;
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
updateSolidSetting: (
|
|
41
|
+
state,
|
|
42
|
+
action: PayloadAction<{ key: string; value: any }>
|
|
43
|
+
) => {
|
|
44
|
+
state.solidSettings[action.payload.key] = action.payload.value;
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
// -------- RESET --------
|
|
48
|
+
resetSettings: () => initialState,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export default settingsSlice.reducer;
|
|
53
|
+
|
|
54
|
+
export const {
|
|
55
|
+
// setAuthSettings,
|
|
56
|
+
// updateAuthSetting,
|
|
57
|
+
setSolidSettings,
|
|
58
|
+
updateSolidSetting,
|
|
59
|
+
resetSettings,
|
|
60
|
+
} = settingsSlice.actions;
|
|
@@ -2753,6 +2753,10 @@ li.header-li-px {
|
|
|
2753
2753
|
height: auto;
|
|
2754
2754
|
}
|
|
2755
2755
|
|
|
2756
|
+
.solid-custom-filter-wrapper {
|
|
2757
|
+
z-index: 85;
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2756
2760
|
.custom-filter-button {
|
|
2757
2761
|
border-right: 0;
|
|
2758
2762
|
border-top: 0;
|
|
@@ -2897,6 +2901,7 @@ li.header-li-px {
|
|
|
2897
2901
|
.solid-chip-manager-panel {
|
|
2898
2902
|
top: calc(100% + 6px);
|
|
2899
2903
|
left: 0;
|
|
2904
|
+
z-index: 90 !important;
|
|
2900
2905
|
width: min(360px, 100%);
|
|
2901
2906
|
background: var(--card);
|
|
2902
2907
|
border: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
|
|
@@ -3880,7 +3885,8 @@ li.header-li-px {
|
|
|
3880
3885
|
|
|
3881
3886
|
.solid-search-overlay-pannel {
|
|
3882
3887
|
top: calc(100% + 4px) !important;
|
|
3883
|
-
|
|
3888
|
+
/* Keep above datatable sticky headers/columns and other elevated surfaces. */
|
|
3889
|
+
z-index: 1004 !important;
|
|
3884
3890
|
background: var(--card);
|
|
3885
3891
|
border: 1px solid color-mix(in srgb, var(--border) 86%, transparent) !important;
|
|
3886
3892
|
border-radius: 10px;
|
|
@@ -846,13 +846,16 @@ body {
|
|
|
846
846
|
|
|
847
847
|
.solid-toast-viewport {
|
|
848
848
|
position: fixed;
|
|
849
|
-
top:
|
|
850
|
-
|
|
849
|
+
top: 10px;
|
|
850
|
+
left: 50%;
|
|
851
|
+
transform: translateX(-50%);
|
|
851
852
|
z-index: calc(var(--z-overlay) + 6);
|
|
852
853
|
display: flex;
|
|
853
854
|
flex-direction: column;
|
|
855
|
+
align-items: center;
|
|
854
856
|
gap: 10px;
|
|
855
|
-
width:
|
|
857
|
+
width: calc(100vw - 24px);
|
|
858
|
+
max-width: 100%;
|
|
856
859
|
pointer-events: none;
|
|
857
860
|
}
|
|
858
861
|
|
|
@@ -860,7 +863,7 @@ body {
|
|
|
860
863
|
display: flex;
|
|
861
864
|
align-items: flex-start;
|
|
862
865
|
gap: 10px;
|
|
863
|
-
width: 100
|
|
866
|
+
width: min(420px, 100%);
|
|
864
867
|
padding: 12px;
|
|
865
868
|
border-radius: 14px;
|
|
866
869
|
border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
|
|
@@ -1351,6 +1354,7 @@ body {
|
|
|
1351
1354
|
.solid-autocomplete {
|
|
1352
1355
|
position: relative;
|
|
1353
1356
|
width: 100%;
|
|
1357
|
+
min-width: 0;
|
|
1354
1358
|
}
|
|
1355
1359
|
|
|
1356
1360
|
.solid-autocomplete-control {
|
|
@@ -1358,6 +1362,7 @@ body {
|
|
|
1358
1362
|
display: flex;
|
|
1359
1363
|
align-items: center;
|
|
1360
1364
|
width: 100%;
|
|
1365
|
+
min-width: 0;
|
|
1361
1366
|
}
|
|
1362
1367
|
|
|
1363
1368
|
.solid-autocomplete-chip-control {
|
|
@@ -1385,6 +1390,8 @@ body {
|
|
|
1385
1390
|
min-height: 24px;
|
|
1386
1391
|
height: 24px;
|
|
1387
1392
|
flex: 1 1 110px;
|
|
1393
|
+
min-width: 0;
|
|
1394
|
+
max-width: 100%;
|
|
1388
1395
|
padding: 0 4px;
|
|
1389
1396
|
}
|
|
1390
1397
|
|
|
@@ -1458,6 +1465,8 @@ body {
|
|
|
1458
1465
|
align-items: center;
|
|
1459
1466
|
gap: 4px;
|
|
1460
1467
|
min-height: 22px;
|
|
1468
|
+
min-width: 0;
|
|
1469
|
+
max-width: 100%;
|
|
1461
1470
|
border-radius: 999px;
|
|
1462
1471
|
border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
|
|
1463
1472
|
background: color-mix(in srgb, var(--primary) 10%, transparent);
|
|
@@ -1467,6 +1476,8 @@ body {
|
|
|
1467
1476
|
}
|
|
1468
1477
|
|
|
1469
1478
|
.solid-autocomplete-chip-label {
|
|
1479
|
+
min-width: 0;
|
|
1480
|
+
max-width: 100%;
|
|
1470
1481
|
overflow: hidden;
|
|
1471
1482
|
text-overflow: ellipsis;
|
|
1472
1483
|
white-space: nowrap;
|
|
@@ -1860,15 +1871,20 @@ body {
|
|
|
1860
1871
|
}
|
|
1861
1872
|
|
|
1862
1873
|
.solid-auth-social-grid {
|
|
1863
|
-
display:
|
|
1864
|
-
|
|
1874
|
+
display: flex;
|
|
1875
|
+
flex-wrap: wrap;
|
|
1876
|
+
justify-content: center;
|
|
1877
|
+
align-items: center;
|
|
1865
1878
|
gap: 8px;
|
|
1879
|
+
width: 100%;
|
|
1880
|
+
margin-inline: auto;
|
|
1866
1881
|
}
|
|
1867
1882
|
|
|
1868
1883
|
.solid-auth-social-btn.solid-btn {
|
|
1869
|
-
width:
|
|
1884
|
+
width: 88px;
|
|
1870
1885
|
height: 36px;
|
|
1871
1886
|
min-height: 36px;
|
|
1887
|
+
flex: 0 0 88px;
|
|
1872
1888
|
border-radius: 8px;
|
|
1873
1889
|
padding: 0;
|
|
1874
1890
|
display: inline-flex;
|
|
@@ -2826,7 +2842,7 @@ body {
|
|
|
2826
2842
|
opacity: 0.34;
|
|
2827
2843
|
}
|
|
2828
2844
|
|
|
2829
|
-
.solid-auth-theme-wrapper >
|
|
2845
|
+
.solid-auth-theme-wrapper > *:not(.solid-toast-viewport) {
|
|
2830
2846
|
position: relative;
|
|
2831
2847
|
z-index: 1;
|
|
2832
2848
|
}
|
|
@@ -4141,7 +4157,7 @@ html.dark .solid-paginator-btn:hover:not(:disabled),
|
|
|
4141
4157
|
|
|
4142
4158
|
.solid-popover-content[data-side="bottom"][data-align="end"] {
|
|
4143
4159
|
right: 0;
|
|
4144
|
-
left:
|
|
4160
|
+
left: auto;
|
|
4145
4161
|
}
|
|
4146
4162
|
|
|
4147
4163
|
.solid-popover-content[data-side="top"] {
|