rez_core 2.2.205 → 2.2.208
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/module/notification/controller/otp.controller.d.ts +2 -0
- package/dist/module/notification/service/otp.service.d.ts +2 -0
- package/dist/module/user/controller/login.controller.js +34 -2
- package/dist/module/user/controller/login.controller.js.map +1 -1
- package/dist/module/user/service/login.service.d.ts +4 -0
- package/dist/module/user/service/login.service.js +9 -0
- package/dist/module/user/service/login.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/user/controller/login.controller.ts +37 -2
- package/src/module/user/service/login.service.ts +12 -0
- package/src/resources/dev.properties.yaml +1 -0
package/package.json
CHANGED
|
@@ -114,9 +114,38 @@ export class LoginController {
|
|
|
114
114
|
actualState,
|
|
115
115
|
);
|
|
116
116
|
|
|
117
|
-
return res.redirect(
|
|
117
|
+
return res.redirect(`
|
|
118
|
+
<html>
|
|
119
|
+
<body>
|
|
120
|
+
<script>
|
|
121
|
+
// Notify parent window that OAuth succeeded
|
|
122
|
+
if (window.opener) {
|
|
123
|
+
window.opener.postMessage({ type: 'CONFIG_SUCCESS' }, '*');
|
|
124
|
+
}
|
|
125
|
+
// Close the popup window
|
|
126
|
+
window.close();
|
|
127
|
+
</script>
|
|
128
|
+
<p>Configuration successful. You can close this window.</p>
|
|
129
|
+
</body>
|
|
130
|
+
</html>
|
|
131
|
+
`);
|
|
118
132
|
} catch (error) {
|
|
119
|
-
return res.redirect(
|
|
133
|
+
return res.redirect(`
|
|
134
|
+
<html>
|
|
135
|
+
<body>
|
|
136
|
+
<script>
|
|
137
|
+
if (window.opener) {
|
|
138
|
+
window.opener.postMessage({
|
|
139
|
+
type: "CONFIG_FAILED",
|
|
140
|
+
error: "${error.message || 'Something went wrong'}"
|
|
141
|
+
}, "*");
|
|
142
|
+
}
|
|
143
|
+
window.close();
|
|
144
|
+
</script>
|
|
145
|
+
<p>Configuration failed. Please close this window.</p>
|
|
146
|
+
</body>
|
|
147
|
+
</html>
|
|
148
|
+
`);
|
|
120
149
|
}
|
|
121
150
|
}
|
|
122
151
|
|
|
@@ -136,6 +165,12 @@ export class LoginController {
|
|
|
136
165
|
);
|
|
137
166
|
|
|
138
167
|
const { accessToken, appcode } = data;
|
|
168
|
+
if (data.slug) {
|
|
169
|
+
return res.redirect(
|
|
170
|
+
`https://${data.slug}.${this.configService.get('DOMAIN_URL')}/auth?token=${accessToken}&appcode=${appcode}`,
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
139
174
|
return res.redirect(
|
|
140
175
|
`${this.configService.get('BASE_URL')}/auth?token=${accessToken}&appcode=${appcode}`,
|
|
141
176
|
);
|
|
@@ -180,12 +180,24 @@ export class LoginService {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
// 🔹 Step 8: Return response
|
|
183
|
+
|
|
184
|
+
const org = await this.organizationRepository.findOrganizationById(
|
|
185
|
+
user.organization_id,
|
|
186
|
+
);
|
|
187
|
+
let slug: string;
|
|
188
|
+
if (org) {
|
|
189
|
+
slug = org.subdomain;
|
|
190
|
+
} else {
|
|
191
|
+
throw new BadRequestException();
|
|
192
|
+
}
|
|
193
|
+
|
|
183
194
|
return {
|
|
184
195
|
success: true,
|
|
185
196
|
accessToken: token,
|
|
186
197
|
appcode: defaultAccess.appcode,
|
|
187
198
|
level_type: defaultAccess.level_type,
|
|
188
199
|
level_id: defaultAccess.level_id,
|
|
200
|
+
slug: slug,
|
|
189
201
|
};
|
|
190
202
|
}
|
|
191
203
|
|
|
@@ -11,6 +11,7 @@ CLIENT_ID: '819281384645-2tnuvm80sul1n2ahqa4eg6kjd19pnbu9.apps.googleusercontent
|
|
|
11
11
|
CLIENT_SECRET: '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'
|
|
12
12
|
CALLBACK_URL: 'http://localhost:5001/auth/google/callback'
|
|
13
13
|
BASE_URL: 'http://localhost:5001'
|
|
14
|
+
DOMAIN_URL: 'rezolut.in'
|
|
14
15
|
OTP_EXPIRY: '10'
|
|
15
16
|
OTP_LENGTH: '6'
|
|
16
17
|
VERIFY_OTP: 'false'
|