cloud-ide-auth 1.0.14 → 1.0.15
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.
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, inject, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormGroup, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
import { Router, ActivatedRoute, RouterLink } from '@angular/router';
|
|
7
|
+
import { CloudIdeAuthService } from './cloud-ide-auth.mjs';
|
|
8
|
+
import { CideInputComponent, CideEleButtonComponent } from 'cloud-ide-element';
|
|
9
|
+
import { CideLytSharedWrapperComponent, AppStateHelperService } from 'cloud-ide-layout';
|
|
10
|
+
|
|
11
|
+
class CideAuthSignInComponent extends CideLytSharedWrapperComponent {
|
|
12
|
+
shared_wrapper_setup_param = input({
|
|
13
|
+
sypg_page_code: "auth_sign_in"
|
|
14
|
+
}, ...(ngDevMode ? [{ debugName: "shared_wrapper_setup_param" }] : []));
|
|
15
|
+
setup_param = { form_loading: false };
|
|
16
|
+
loginForm;
|
|
17
|
+
erro_message = "";
|
|
18
|
+
returnUrl = '/control-panel'; // Default return URL
|
|
19
|
+
router = inject(Router);
|
|
20
|
+
activatedRoute = inject(ActivatedRoute);
|
|
21
|
+
authService = inject(CloudIdeAuthService);
|
|
22
|
+
appStateService = inject(AppStateHelperService);
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.loginForm = new FormGroup({
|
|
26
|
+
custom_login_method: new FormControl('pass'),
|
|
27
|
+
user_username: new FormControl(''),
|
|
28
|
+
user_password: new FormControl(''),
|
|
29
|
+
mpin_pin: new FormControl(''),
|
|
30
|
+
stay_sign_in: new FormControl(true)
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
ngOnInit() {
|
|
34
|
+
super.ngOnInit();
|
|
35
|
+
// Get return URL from route parameters or default to '/control-panel'
|
|
36
|
+
this.returnUrl = this.activatedRoute.snapshot.queryParams['returnUrl'] || 'control-panel';
|
|
37
|
+
// If user is already authenticated, redirect to the return URL
|
|
38
|
+
if (this.authService.isAuthenticated() && !this.authService.isTokenExpired()) {
|
|
39
|
+
this.router.navigateByUrl(this.returnUrl);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
onSignIn() {
|
|
43
|
+
if (this.loginForm.valid) {
|
|
44
|
+
this.setup_param.form_loading = true;
|
|
45
|
+
this.authService.signIn(this.loginForm?.value)?.subscribe({
|
|
46
|
+
next: async (response) => {
|
|
47
|
+
if (response?.success === true) {
|
|
48
|
+
// Store user data in auth service
|
|
49
|
+
this.authService.storeUserData(response?.data?.auth_user_mst || {});
|
|
50
|
+
// Synchronize AppStateService with the same user data
|
|
51
|
+
this.appStateService.setUser(response?.data?.auth_user_mst || null);
|
|
52
|
+
// Store active entity data
|
|
53
|
+
this.appStateService.setActiveEntity(response?.data?.core_system_entity || null);
|
|
54
|
+
// Store token through the service setter which saves to localStorage
|
|
55
|
+
this.authService.auth_token = (response?.token || '');
|
|
56
|
+
console.log(response?.token);
|
|
57
|
+
// Navigate to the return URL or control panel
|
|
58
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
59
|
+
this.router.navigateByUrl(this.returnUrl);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
error: (error) => {
|
|
63
|
+
this.setup_param.form_loading = false;
|
|
64
|
+
this.erro_message = error?.error?.message;
|
|
65
|
+
console.log(error);
|
|
66
|
+
// Modern ES2022+ pattern: Use Promise-based delay
|
|
67
|
+
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
68
|
+
delay(3000).then(() => {
|
|
69
|
+
this.erro_message = "";
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideAuthSignInComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
76
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: CideAuthSignInComponent, isStandalone: true, selector: "cide-auth-sign-in", inputs: { shared_wrapper_setup_param: { classPropertyName: "shared_wrapper_setup_param", publicName: "shared_wrapper_setup_param", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<!-- https://play.tailwindcss.com/lfO85drpUy -->\n<!-- Main Div Outer Div-->\n<div class=\"cide-font-poppins tw-flex tw-min-h-screen tw-w-full tw-bg-gray-50 tw-py-3\">\n <!-- Login Forrm Wrapper -->\n <div class=\"tw-m-auto tw-w-96 tw-rounded-2xl tw-bg-white tw-py-6 tw-shadow-xl\">\n <!-- Logo Wrapper -->\n <div class=\"tw-m-auto tw-h-32 tw-w-64 tw-text-center\">\n <img src=\"https://console.cloudidesys.com/assets/Cloud%20IDE%20Logo%20Dark.png\" class=\"tw-m-auto tw-h-full\"\n alt=\"Cloud IDE Logo\" />\n </div> <!-- Entity name here -->\n <div class=\"tw-my-2 tw-text-center tw-text-xl tw-font-semibold\">SignIn to CloudIDE sys</div>\n <!-- Error Logger -->\n <div class=\"tw-w-full tw-select-none tw-py-1 tw-text-center tw-text-red-500 tw-h-4 tw-text-sm\">{{erro_message}}</div>\n \n <!-- section for controls -->\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSignIn()\" novalidate>\n <div class=\"tw-m-auto tw-pb-3 tw-pt-3\">\n <!-- Username -->\n <div class=\"tw-m-auto tw-w-80\">\n <cide-ele-input id=\"user_username\" formControlName=\"user_username\"></cide-ele-input>\n </div>\n <!-- Password -->\n <div class=\"tw-m-auto tw-mt-4 tw-w-80\">\n <cide-ele-input id=\"user_password_mpin\" formControlName=\"user_password\"></cide-ele-input>\n </div>\n <!-- Forgot password -->\n <div class=\"tw-m-auto tw-mt-3 tw-flex tw-w-80 tw-justify-between\">\n <div>\n <cide-ele-input id=\"stay_sign_in\" formControlName=\"stay_sign_in\"></cide-ele-input>\n </div>\n <div>\n <a routerLink=\"/auth/forgot-password\" class=\"tw-text-blue-700\">Forgot Password?</a>\n </div>\n </div> <!-- Sign in button -->\n <div class=\"tw-w-80 tw-m-auto tw-mt-3\">\n <button type=\"submit\" class=\"tw-w-full\" cideEleButton id=\"stay_sin_button\" [loading]=\"setup_param.form_loading\" [disabled]=\"!loginForm.valid\">a</button>\n </div>\n </div>\n </form>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "component", type: CideInputComponent, selector: "cide-ele-input", inputs: ["fill", "label", "labelHide", "disabled", "clearInput", "labelPlacement", "labelDir", "placeholder", "leadingIcon", "trailingIcon", "helperText", "helperTextCollapse", "hideHelperAndErrorText", "errorText", "maxlength", "minlength", "required", "autocapitalize", "autocomplete", "type", "width", "id", "ngModel", "option", "min", "max", "size"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: CideEleButtonComponent, selector: "button[cideEleButton], a[cideEleButton]", inputs: ["label", "variant", "size", "type", "shape", "elevation", "disabled", "id", "loading", "fullWidth", "leftIcon", "rightIcon", "customClass", "tooltip", "ariaLabel", "testId", "routerLink", "routerExtras", "preventDoubleClick", "animated"], outputs: ["btnClick", "doubleClick"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
77
|
+
}
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideAuthSignInComponent, decorators: [{
|
|
79
|
+
type: Component,
|
|
80
|
+
args: [{ selector: 'cide-auth-sign-in', standalone: true, imports: [CideInputComponent, ReactiveFormsModule, CommonModule, CideEleButtonComponent, RouterLink], template: "<!-- https://play.tailwindcss.com/lfO85drpUy -->\n<!-- Main Div Outer Div-->\n<div class=\"cide-font-poppins tw-flex tw-min-h-screen tw-w-full tw-bg-gray-50 tw-py-3\">\n <!-- Login Forrm Wrapper -->\n <div class=\"tw-m-auto tw-w-96 tw-rounded-2xl tw-bg-white tw-py-6 tw-shadow-xl\">\n <!-- Logo Wrapper -->\n <div class=\"tw-m-auto tw-h-32 tw-w-64 tw-text-center\">\n <img src=\"https://console.cloudidesys.com/assets/Cloud%20IDE%20Logo%20Dark.png\" class=\"tw-m-auto tw-h-full\"\n alt=\"Cloud IDE Logo\" />\n </div> <!-- Entity name here -->\n <div class=\"tw-my-2 tw-text-center tw-text-xl tw-font-semibold\">SignIn to CloudIDE sys</div>\n <!-- Error Logger -->\n <div class=\"tw-w-full tw-select-none tw-py-1 tw-text-center tw-text-red-500 tw-h-4 tw-text-sm\">{{erro_message}}</div>\n \n <!-- section for controls -->\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSignIn()\" novalidate>\n <div class=\"tw-m-auto tw-pb-3 tw-pt-3\">\n <!-- Username -->\n <div class=\"tw-m-auto tw-w-80\">\n <cide-ele-input id=\"user_username\" formControlName=\"user_username\"></cide-ele-input>\n </div>\n <!-- Password -->\n <div class=\"tw-m-auto tw-mt-4 tw-w-80\">\n <cide-ele-input id=\"user_password_mpin\" formControlName=\"user_password\"></cide-ele-input>\n </div>\n <!-- Forgot password -->\n <div class=\"tw-m-auto tw-mt-3 tw-flex tw-w-80 tw-justify-between\">\n <div>\n <cide-ele-input id=\"stay_sign_in\" formControlName=\"stay_sign_in\"></cide-ele-input>\n </div>\n <div>\n <a routerLink=\"/auth/forgot-password\" class=\"tw-text-blue-700\">Forgot Password?</a>\n </div>\n </div> <!-- Sign in button -->\n <div class=\"tw-w-80 tw-m-auto tw-mt-3\">\n <button type=\"submit\" class=\"tw-w-full\" cideEleButton id=\"stay_sin_button\" [loading]=\"setup_param.form_loading\" [disabled]=\"!loginForm.valid\">a</button>\n </div>\n </div>\n </form>\n </div>\n</div>" }]
|
|
81
|
+
}], ctorParameters: () => [] });
|
|
82
|
+
|
|
83
|
+
export { CideAuthSignInComponent };
|
|
84
|
+
//# sourceMappingURL=cloud-ide-auth-sign-in.component-CVfjGwuu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-ide-auth-sign-in.component-CVfjGwuu.mjs","sources":["../../../projects/cloud-ide-auth/src/lib/auth/sign-in/sign-in.component.ts","../../../projects/cloud-ide-auth/src/lib/auth/sign-in/sign-in.component.html"],"sourcesContent":["import { Component, inject, input, OnInit } from '@angular/core';\nimport { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { loginMethod, MLogin } from 'cloud-ide-lms-model';\nimport { Router, RouterLink, ActivatedRoute } from '@angular/router';\nimport { CloudIdeAuthService } from '../../cloud-ide-auth.service';\nimport { CideEleButtonComponent, CideInputComponent } from 'cloud-ide-element';\nimport { CideLytSharedWrapperComponent, CideLytSharedWrapperSetupParam, AppStateHelperService } from 'cloud-ide-layout';\n\nexport type FormGroupModel<T> = FormGroup<{\n [K in keyof T]: FormControl<T[K]>\n}>\n\n@Component({\n selector: 'cide-auth-sign-in',\n standalone: true,\n imports: [CideInputComponent, ReactiveFormsModule, CommonModule, CideEleButtonComponent, RouterLink],\n templateUrl: './sign-in.component.html',\n styleUrl: './sign-in.component.css'\n})\nexport class CideAuthSignInComponent extends CideLytSharedWrapperComponent implements OnInit {\n public override shared_wrapper_setup_param = input<Partial<CideLytSharedWrapperSetupParam>>({\n sypg_page_code: \"auth_sign_in\"\n });\n public setup_param = { form_loading: false };\n public loginForm: FormGroupModel<MLogin>;\n public erro_message = \"\";\n private returnUrl: string = '/control-panel'; // Default return URL\n private router = inject(Router);\n private activatedRoute = inject(ActivatedRoute);\n private authService = inject(CloudIdeAuthService);\n private appStateService = inject(AppStateHelperService);\n constructor(\n ) {\n super();\n\n this.loginForm = new FormGroup({\n custom_login_method: new FormControl<loginMethod>('pass'),\n user_username: new FormControl(''),\n user_password: new FormControl(''),\n mpin_pin: new FormControl(''),\n stay_sign_in: new FormControl(true)\n }) as unknown as FormGroupModel<MLogin>;\n }\n\n override ngOnInit(): void {\n super.ngOnInit();\n\n // Get return URL from route parameters or default to '/control-panel'\n this.returnUrl = this.activatedRoute.snapshot.queryParams['returnUrl'] || 'control-panel';\n\n // If user is already authenticated, redirect to the return URL\n if (this.authService.isAuthenticated() && !this.authService.isTokenExpired()) {\n this.router.navigateByUrl(this.returnUrl);\n }\n }\n\n onSignIn(): void {\n if (this.loginForm.valid) {\n this.setup_param.form_loading = true;\n this.authService.signIn(this.loginForm?.value as MLogin)?.subscribe({\n next: async (response) => {\n if (response?.success === true) {\n // Store user data in auth service\n this.authService.storeUserData(response?.data?.auth_user_mst || {});\n\n // Synchronize AppStateService with the same user data \n this.appStateService.setUser(response?.data?.auth_user_mst || null);\n\n // Store active entity data\n this.appStateService.setActiveEntity(response?.data?.core_system_entity || null);\n\n // Store token through the service setter which saves to localStorage\n this.authService.auth_token = (response?.token || '');\n console.log(response?.token);\n\n // Navigate to the return URL or control panel\n await new Promise(resolve => setTimeout(resolve, 2000));\n this.router.navigateByUrl(this.returnUrl);\n }\n },\n error: (error) => {\n this.setup_param.form_loading = false;\n this.erro_message = error?.error?.message;\n console.log(error);\n // Modern ES2022+ pattern: Use Promise-based delay\n const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));\n delay(3000).then(() => {\n this.erro_message = \"\";\n });\n }\n });\n }\n }\n}","<!-- https://play.tailwindcss.com/lfO85drpUy -->\n<!-- Main Div Outer Div-->\n<div class=\"cide-font-poppins tw-flex tw-min-h-screen tw-w-full tw-bg-gray-50 tw-py-3\">\n <!-- Login Forrm Wrapper -->\n <div class=\"tw-m-auto tw-w-96 tw-rounded-2xl tw-bg-white tw-py-6 tw-shadow-xl\">\n <!-- Logo Wrapper -->\n <div class=\"tw-m-auto tw-h-32 tw-w-64 tw-text-center\">\n <img src=\"https://console.cloudidesys.com/assets/Cloud%20IDE%20Logo%20Dark.png\" class=\"tw-m-auto tw-h-full\"\n alt=\"Cloud IDE Logo\" />\n </div> <!-- Entity name here -->\n <div class=\"tw-my-2 tw-text-center tw-text-xl tw-font-semibold\">SignIn to CloudIDE sys</div>\n <!-- Error Logger -->\n <div class=\"tw-w-full tw-select-none tw-py-1 tw-text-center tw-text-red-500 tw-h-4 tw-text-sm\">{{erro_message}}</div>\n \n <!-- section for controls -->\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSignIn()\" novalidate>\n <div class=\"tw-m-auto tw-pb-3 tw-pt-3\">\n <!-- Username -->\n <div class=\"tw-m-auto tw-w-80\">\n <cide-ele-input id=\"user_username\" formControlName=\"user_username\"></cide-ele-input>\n </div>\n <!-- Password -->\n <div class=\"tw-m-auto tw-mt-4 tw-w-80\">\n <cide-ele-input id=\"user_password_mpin\" formControlName=\"user_password\"></cide-ele-input>\n </div>\n <!-- Forgot password -->\n <div class=\"tw-m-auto tw-mt-3 tw-flex tw-w-80 tw-justify-between\">\n <div>\n <cide-ele-input id=\"stay_sign_in\" formControlName=\"stay_sign_in\"></cide-ele-input>\n </div>\n <div>\n <a routerLink=\"/auth/forgot-password\" class=\"tw-text-blue-700\">Forgot Password?</a>\n </div>\n </div> <!-- Sign in button -->\n <div class=\"tw-w-80 tw-m-auto tw-mt-3\">\n <button type=\"submit\" class=\"tw-w-full\" cideEleButton id=\"stay_sin_button\" [loading]=\"setup_param.form_loading\" [disabled]=\"!loginForm.valid\">a</button>\n </div>\n </div>\n </form>\n </div>\n</div>"],"names":[],"mappings":";;;;;;;;;;AAoBM,MAAO,uBAAwB,SAAQ,6BAA6B,CAAA;IACxD,0BAA0B,GAAG,KAAK,CAA0C;AAC1F,QAAA,cAAc,EAAE;AACjB,KAAA,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,4BAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC;AACK,IAAA,WAAW,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE;AACrC,IAAA,SAAS;IACT,YAAY,GAAG,EAAE;AAChB,IAAA,SAAS,GAAW,gBAAgB,CAAC;AACrC,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACvC,IAAA,WAAW,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACzC,IAAA,eAAe,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAA,WAAA,GAAA;AAEE,QAAA,KAAK,EAAE;AAEP,QAAA,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC;AAC7B,YAAA,mBAAmB,EAAE,IAAI,WAAW,CAAc,MAAM,CAAC;AACzD,YAAA,aAAa,EAAE,IAAI,WAAW,CAAC,EAAE,CAAC;AAClC,YAAA,aAAa,EAAE,IAAI,WAAW,CAAC,EAAE,CAAC;AAClC,YAAA,QAAQ,EAAE,IAAI,WAAW,CAAC,EAAE,CAAC;AAC7B,YAAA,YAAY,EAAE,IAAI,WAAW,CAAC,IAAI;AACnC,SAAA,CAAsC;;IAGhC,QAAQ,GAAA;QACf,KAAK,CAAC,QAAQ,EAAE;;AAGhB,QAAA,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,cAAc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A,SAAA,EAAA,WAAA,EAAA,QAAA,EAAA,YAAA,EAAA,cAAA,EAAA,oBAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,EAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,UAAU,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAIxF,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAPnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAAA,UAAA,EACjB,IAAI,EAAA,OAAA,EACP,CAAC,kBAAkB,EAAE,mBAAmB,EAAE,YAAY,EAAE,sBAAsB,EAAE,UAAU,CAAC,EAAA,QAAA,EAAA,yiEAAA,EAAA;;;;;"}
|
|
@@ -3,11 +3,12 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import { inject, Injectable, Component } from '@angular/core';
|
|
4
4
|
import { cidePath, hostManagerRoutesUrl, authRoutesUrl, MResetPassword, validateRequestModal, MForgotPassword } from 'cloud-ide-lms-model';
|
|
5
5
|
import { BehaviorSubject } from 'rxjs';
|
|
6
|
-
import { RouterOutlet, Router
|
|
6
|
+
import { RouterOutlet, Router } from '@angular/router';
|
|
7
7
|
import * as i1 from '@angular/forms';
|
|
8
8
|
import { FormGroup, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import { CommonModule } from '@angular/common';
|
|
10
10
|
import { CideInputComponent, CideEleButtonComponent } from 'cloud-ide-element';
|
|
11
|
+
import { AUTH_SERVICE_TOKEN, APP_STATE_SERVICE_TOKEN } from 'cloud-ide-shared';
|
|
11
12
|
|
|
12
13
|
class CloudIdeAuthService {
|
|
13
14
|
auth_user_mst = new BehaviorSubject({});
|
|
@@ -246,78 +247,6 @@ var forgotPassword_component = /*#__PURE__*/Object.freeze({
|
|
|
246
247
|
CideAuthForgotPasswordComponent: CideAuthForgotPasswordComponent
|
|
247
248
|
});
|
|
248
249
|
|
|
249
|
-
class CideAuthSignInComponent {
|
|
250
|
-
// public override shared_wrapper_setup_param = input<Partial<CideLytSharedWrapperSetupParam>>({
|
|
251
|
-
// sypg_page_code: "auth_sign_in"
|
|
252
|
-
// });
|
|
253
|
-
setup_param = { form_loading: false };
|
|
254
|
-
loginForm;
|
|
255
|
-
erro_message = "";
|
|
256
|
-
returnUrl = '/control-panel'; // Default return URL
|
|
257
|
-
router = inject(Router);
|
|
258
|
-
activatedRoute = inject(ActivatedRoute);
|
|
259
|
-
authService = inject(CloudIdeAuthService);
|
|
260
|
-
// private appStateService = inject(AppStateHelperService);
|
|
261
|
-
constructor() {
|
|
262
|
-
// super();
|
|
263
|
-
this.loginForm = new FormGroup({
|
|
264
|
-
custom_login_method: new FormControl('pass'),
|
|
265
|
-
user_username: new FormControl(''),
|
|
266
|
-
user_password: new FormControl(''),
|
|
267
|
-
mpin_pin: new FormControl(''),
|
|
268
|
-
stay_sign_in: new FormControl(true)
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
ngOnInit() {
|
|
272
|
-
// super.ngOnInit();
|
|
273
|
-
// Get return URL from route parameters or default to '/control-panel'
|
|
274
|
-
this.returnUrl = this.activatedRoute.snapshot.queryParams['returnUrl'] || 'control-panel';
|
|
275
|
-
// If user is already authenticated, redirect to the return URL
|
|
276
|
-
if (this.authService.isAuthenticated() && !this.authService.isTokenExpired()) {
|
|
277
|
-
this.router.navigateByUrl(this.returnUrl);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
onSignIn() {
|
|
281
|
-
if (this.loginForm.valid) {
|
|
282
|
-
this.setup_param.form_loading = true;
|
|
283
|
-
this.authService.signIn(this.loginForm?.value)?.subscribe({
|
|
284
|
-
next: async (response) => {
|
|
285
|
-
if (response?.success === true) {
|
|
286
|
-
// Store user data in auth service
|
|
287
|
-
this.authService.storeUserData(response?.data?.auth_user_mst || {});
|
|
288
|
-
// Synchronize AppStateService with the same user data
|
|
289
|
-
// this.appStateService.setUser(response?.data?.auth_user_mst || null);
|
|
290
|
-
// // Store active entity data
|
|
291
|
-
// this.appStateService.setActiveEntity(response?.data?.core_system_entity || null);
|
|
292
|
-
// Store token through the service setter which saves to localStorage
|
|
293
|
-
this.authService.auth_token = (response?.token || '');
|
|
294
|
-
console.log(response?.token);
|
|
295
|
-
// Navigate to the return URL or control panel
|
|
296
|
-
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
297
|
-
this.router.navigateByUrl(this.returnUrl);
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
error: (error) => {
|
|
301
|
-
this.setup_param.form_loading = false;
|
|
302
|
-
this.erro_message = error?.error?.message;
|
|
303
|
-
console.log(error);
|
|
304
|
-
// Modern ES2022+ pattern: Use Promise-based delay
|
|
305
|
-
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
306
|
-
delay(3000).then(() => {
|
|
307
|
-
this.erro_message = "";
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideAuthSignInComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
314
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.7", type: CideAuthSignInComponent, isStandalone: true, selector: "cide-auth-sign-in", ngImport: i0, template: "<!-- https://play.tailwindcss.com/lfO85drpUy -->\n<!-- Main Div Outer Div-->\n<div class=\"cide-font-poppins tw-flex tw-min-h-screen tw-w-full tw-bg-gray-50 tw-py-3\">\n <!-- Login Forrm Wrapper -->\n <div class=\"tw-m-auto tw-w-96 tw-rounded-2xl tw-bg-white tw-py-6 tw-shadow-xl\">\n <!-- Logo Wrapper -->\n <div class=\"tw-m-auto tw-h-32 tw-w-64 tw-text-center\">\n <img src=\"https://console.cloudidesys.com/assets/Cloud%20IDE%20Logo%20Dark.png\" class=\"tw-m-auto tw-h-full\"\n alt=\"Cloud IDE Logo\" />\n </div> <!-- Entity name here -->\n <div class=\"tw-my-2 tw-text-center tw-text-xl tw-font-semibold\">SignIn to CloudIDE sys</div>\n <!-- Error Logger -->\n <div class=\"tw-w-full tw-select-none tw-py-1 tw-text-center tw-text-red-500 tw-h-4 tw-text-sm\">{{erro_message}}</div>\n \n <!-- section for controls -->\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSignIn()\" novalidate>\n <div class=\"tw-m-auto tw-pb-3 tw-pt-3\">\n <!-- Username -->\n <div class=\"tw-m-auto tw-w-80\">\n <cide-ele-input id=\"user_username\" formControlName=\"user_username\"></cide-ele-input>\n </div>\n <!-- Password -->\n <div class=\"tw-m-auto tw-mt-4 tw-w-80\">\n <cide-ele-input id=\"user_password_mpin\" formControlName=\"user_password\"></cide-ele-input>\n </div>\n <!-- Forgot password -->\n <div class=\"tw-m-auto tw-mt-3 tw-flex tw-w-80 tw-justify-between\">\n <div>\n <cide-ele-input id=\"stay_sign_in\" formControlName=\"stay_sign_in\"></cide-ele-input>\n </div>\n <div>\n <a routerLink=\"/auth/forgot-password\" class=\"tw-text-blue-700\">Forgot Password?</a>\n </div>\n </div> <!-- Sign in button -->\n <div class=\"tw-w-80 tw-m-auto tw-mt-3\">\n <button type=\"submit\" class=\"tw-w-full\" cideEleButton id=\"stay_sin_button\" [loading]=\"setup_param.form_loading\" [disabled]=\"!loginForm.valid\">a</button>\n </div>\n </div>\n </form>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "component", type: CideInputComponent, selector: "cide-ele-input", inputs: ["fill", "label", "labelHide", "disabled", "clearInput", "labelPlacement", "labelDir", "placeholder", "leadingIcon", "trailingIcon", "helperText", "helperTextCollapse", "hideHelperAndErrorText", "errorText", "maxlength", "minlength", "required", "autocapitalize", "autocomplete", "type", "width", "id", "ngModel", "option", "min", "max", "size"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: CideEleButtonComponent, selector: "button[cideEleButton], a[cideEleButton]", inputs: ["label", "variant", "size", "type", "shape", "elevation", "disabled", "id", "loading", "fullWidth", "leftIcon", "rightIcon", "customClass", "tooltip", "ariaLabel", "testId", "routerLink", "routerExtras", "preventDoubleClick", "animated"], outputs: ["btnClick", "doubleClick"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
315
|
-
}
|
|
316
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideAuthSignInComponent, decorators: [{
|
|
317
|
-
type: Component,
|
|
318
|
-
args: [{ selector: 'cide-auth-sign-in', standalone: true, imports: [CideInputComponent, ReactiveFormsModule, CommonModule, CideEleButtonComponent, RouterLink], template: "<!-- https://play.tailwindcss.com/lfO85drpUy -->\n<!-- Main Div Outer Div-->\n<div class=\"cide-font-poppins tw-flex tw-min-h-screen tw-w-full tw-bg-gray-50 tw-py-3\">\n <!-- Login Forrm Wrapper -->\n <div class=\"tw-m-auto tw-w-96 tw-rounded-2xl tw-bg-white tw-py-6 tw-shadow-xl\">\n <!-- Logo Wrapper -->\n <div class=\"tw-m-auto tw-h-32 tw-w-64 tw-text-center\">\n <img src=\"https://console.cloudidesys.com/assets/Cloud%20IDE%20Logo%20Dark.png\" class=\"tw-m-auto tw-h-full\"\n alt=\"Cloud IDE Logo\" />\n </div> <!-- Entity name here -->\n <div class=\"tw-my-2 tw-text-center tw-text-xl tw-font-semibold\">SignIn to CloudIDE sys</div>\n <!-- Error Logger -->\n <div class=\"tw-w-full tw-select-none tw-py-1 tw-text-center tw-text-red-500 tw-h-4 tw-text-sm\">{{erro_message}}</div>\n \n <!-- section for controls -->\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSignIn()\" novalidate>\n <div class=\"tw-m-auto tw-pb-3 tw-pt-3\">\n <!-- Username -->\n <div class=\"tw-m-auto tw-w-80\">\n <cide-ele-input id=\"user_username\" formControlName=\"user_username\"></cide-ele-input>\n </div>\n <!-- Password -->\n <div class=\"tw-m-auto tw-mt-4 tw-w-80\">\n <cide-ele-input id=\"user_password_mpin\" formControlName=\"user_password\"></cide-ele-input>\n </div>\n <!-- Forgot password -->\n <div class=\"tw-m-auto tw-mt-3 tw-flex tw-w-80 tw-justify-between\">\n <div>\n <cide-ele-input id=\"stay_sign_in\" formControlName=\"stay_sign_in\"></cide-ele-input>\n </div>\n <div>\n <a routerLink=\"/auth/forgot-password\" class=\"tw-text-blue-700\">Forgot Password?</a>\n </div>\n </div> <!-- Sign in button -->\n <div class=\"tw-w-80 tw-m-auto tw-mt-3\">\n <button type=\"submit\" class=\"tw-w-full\" cideEleButton id=\"stay_sin_button\" [loading]=\"setup_param.form_loading\" [disabled]=\"!loginForm.valid\">a</button>\n </div>\n </div>\n </form>\n </div>\n</div>" }]
|
|
319
|
-
}], ctorParameters: () => [] });
|
|
320
|
-
|
|
321
250
|
const authRoutes = {
|
|
322
251
|
path: "auth",
|
|
323
252
|
loadComponent: () => Promise.resolve().then(function () { return cloudIdeAuth_component; }).then(c => c.CloudIdeAuthComponent),
|
|
@@ -329,8 +258,7 @@ const authRoutes = {
|
|
|
329
258
|
},
|
|
330
259
|
{
|
|
331
260
|
path: "sign-in",
|
|
332
|
-
|
|
333
|
-
component: CideAuthSignInComponent,
|
|
261
|
+
loadComponent: () => import('./cloud-ide-auth-sign-in.component-CVfjGwuu.mjs').then(c => c.CideAuthSignInComponent)
|
|
334
262
|
},
|
|
335
263
|
{
|
|
336
264
|
path: "forgot-password",
|
|
@@ -343,19 +271,18 @@ const authRoutes = {
|
|
|
343
271
|
]
|
|
344
272
|
};
|
|
345
273
|
|
|
346
|
-
// import { AppStateHelperService } from 'cloud-ide-layout';
|
|
347
274
|
const authGuard = (route, state) => {
|
|
348
|
-
const authService = inject(
|
|
349
|
-
|
|
275
|
+
const authService = inject(AUTH_SERVICE_TOKEN);
|
|
276
|
+
const appState = inject(APP_STATE_SERVICE_TOKEN);
|
|
350
277
|
const router = inject(Router);
|
|
351
278
|
// Refresh auth state to make sure it's current
|
|
352
279
|
authService.refreshAuthState();
|
|
353
|
-
//
|
|
354
|
-
|
|
355
|
-
//
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
280
|
+
// Refresh app state from localStorage to ensure synchronization
|
|
281
|
+
appState.refreshFromLocalStorage();
|
|
282
|
+
// Check if user is authenticated using app state (modern approach)
|
|
283
|
+
if (appState.isUserAuthenticated() && !authService.isTokenExpired()) {
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
359
286
|
// Redirect to login page with the intended destination
|
|
360
287
|
router.navigate(['/auth/sign-in'], {
|
|
361
288
|
queryParams: { returnUrl: state.url }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-ide-auth.mjs","sources":["../../../projects/cloud-ide-auth/src/lib/cloud-ide-auth.service.ts","../../../projects/cloud-ide-auth/src/lib/cloud-ide-auth.component.ts","../../../projects/cloud-ide-auth/src/lib/auth/forgot-password/forgot-password.component.ts","../../../projects/cloud-ide-auth/src/lib/auth/forgot-password/forgot-password.component.html","../../../projects/cloud-ide-auth/src/lib/auth/sign-in/sign-in.component.ts","../../../projects/cloud-ide-auth/src/lib/auth/sign-in/sign-in.component.html","../../../projects/cloud-ide-auth/src/lib/cloud-ide-auth.routes.ts","../../../projects/cloud-ide-auth/src/lib/guards/auth.guard.ts","../../../projects/cloud-ide-auth/src/public-api.ts","../../../projects/cloud-ide-auth/src/cloud-ide-auth.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport {\n authRoutesUrl, cidePath, hostManagerRoutesUrl, AuthUserMst,\n loginControllerResponse, MLogin, MForgotPassword, ForgotPasswordControllerResponse,\n MResetPassword, ResetPasswordControllerResponse\n} from 'cloud-ide-lms-model';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CloudIdeAuthService {\n public auth_user_mst: BehaviorSubject<AuthUserMst> = new BehaviorSubject({});\n private _auth_token: string = \"\";\n\n // Storage keys\n private readonly TOKEN_STORAGE_KEY = 'cide_auth_token';\n private readonly USER_STORAGE_KEY = 'cide_auth_user';\n\n // Modern Angular v20 dependency injection pattern\n private http = inject(HttpClient);\n\n constructor() {\n // Modern Angular v20 pattern: Use constructor for initialization only\n this.loadAuthDataFromStorage();\n }\n\n /**\n * Check if localStorage is available (browser environment)\n */\n private isLocalStorageAvailable(): boolean {\n try {\n return typeof window !== 'undefined' && typeof localStorage !== 'undefined';\n } catch {\n return false;\n }\n }\n\n // Getter and setter for auth_token with localStorage persistence\n get auth_token(): string {\n return this._auth_token;\n }\n\n set auth_token(value: string) {\n this._auth_token = value;\n if (!this.isLocalStorageAvailable()) {\n return;\n }\n if (value) {\n localStorage.setItem(this.TOKEN_STORAGE_KEY, value);\n } else {\n localStorage.removeItem(this.TOKEN_STORAGE_KEY);\n }\n }\n\n // Load authentication data from localStorage on service initialization\n private loadAuthDataFromStorage(): void {\n if (!this.isLocalStorageAvailable()) {\n return;\n }\n\n try {\n // Load token\n const storedToken = localStorage.getItem(this.TOKEN_STORAGE_KEY);\n if (storedToken) {\n this._auth_token = storedToken;\n }\n\n // Load user data\n const storedUserData = localStorage.getItem(this.USER_STORAGE_KEY);\n if (storedUserData) {\n const userData = JSON.parse(storedUserData);\n this.auth_user_mst.next(userData);\n }\n } catch (error) {\n console.error('Error loading auth data from storage:', error);\n }\n }\n\n // Store user data in localStorage\n public storeUserData(userData: AuthUserMst): void {\n if (userData) {\n this.auth_user_mst.next(userData);\n if (this.isLocalStorageAvailable()) {\n localStorage.setItem(this.USER_STORAGE_KEY, JSON.stringify(userData));\n }\n }\n }\n\n signIn(body: MLogin): Observable<loginControllerResponse> {\n if (body?.user_password) {\n if (body?.user_password?.length <= 6) {\n body.custom_login_method = \"mpin\";\n body.mpin_pin = body?.user_password;\n body.user_password = \"\";\n }\n }\n return this.http?.post(cidePath?.join([hostManagerRoutesUrl?.cideSuiteHost, authRoutesUrl?.module, authRoutesUrl?.signIn]), body);\n }\n\n forgotPassword(body: MForgotPassword): Observable<ForgotPasswordControllerResponse> {\n return this.http?.post(cidePath?.join([hostManagerRoutesUrl?.cideSuiteHost, authRoutesUrl?.module, authRoutesUrl?.forgotPassword]), body);\n }\n\n resetPassword(body: MResetPassword): Observable<ResetPasswordControllerResponse> {\n const payload = new MResetPassword(body);\n if (payload?.Validate) {\n payload?.Validate();\n }\n return this.http?.post(cidePath?.join([hostManagerRoutesUrl?.cideSuiteHost, authRoutesUrl?.module, authRoutesUrl?.resetPassword]), body);\n }\n\n // Sign out the user and clear all stored auth data\n signOut(): void {\n // Clear token and user data from memory\n this._auth_token = \"\";\n this.auth_user_mst.next({});\n\n // Clear stored data\n if (this.isLocalStorageAvailable()) {\n localStorage.removeItem(this.TOKEN_STORAGE_KEY);\n localStorage.removeItem(this.USER_STORAGE_KEY);\n }\n }\n\n // Check if user is authenticated\n isAuthenticated(): boolean {\n return !!this._auth_token;\n }\n\n // Get current user data \n getCurrentUser(): AuthUserMst {\n return this.auth_user_mst.getValue();\n }\n\n // Check if token is expired\n isTokenExpired(): boolean {\n try {\n if (!this._auth_token) {\n return true;\n }\n\n // Extract the payload from the JWT token\n const tokenParts = this._auth_token.split('.');\n if (tokenParts.length !== 3) {\n return true; // Not a valid JWT token\n }\n\n const payload = JSON.parse(atob(tokenParts[1]));\n\n // Check expiration time\n const expiration = payload.exp * 1000; // Convert seconds to milliseconds\n return Date.now() >= expiration;\n } catch (error) {\n console.error('Error checking token expiration:', error);\n return true; // Assume expired if there's an error\n }\n }\n\n // Refresh auth data if needed based on stored data\n refreshAuthState(): void {\n // If we have a token but no user data, try to load user data\n if (this._auth_token && this.auth_user_mst && Object.keys(this.auth_user_mst.getValue()).length === 0 && this.isLocalStorageAvailable()) {\n const storedUserData = localStorage.getItem(this.USER_STORAGE_KEY);\n if (storedUserData) {\n try {\n const userData = JSON.parse(storedUserData);\n this.auth_user_mst.next(userData);\n } catch (error) {\n console.error('Error parsing stored user data:', error);\n }\n }\n }\n\n // If token is expired, sign out\n if (this.isTokenExpired()) {\n this.signOut();\n }\n }\n}\n","import { Component } from '@angular/core';\r\nimport { RouterOutlet } from '@angular/router';\r\n\r\n@Component({\r\n selector: 'cide-auth-wrapper',\r\n standalone: true,\r\n imports: [RouterOutlet],\r\n template: `\r\n <router-outlet></router-outlet>\r\n `,\r\n styles: ``\r\n})\r\nexport class CloudIdeAuthComponent {\r\n\r\n}\r\n","import { Component, inject } from '@angular/core';\nimport { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { Router } from '@angular/router';\nimport { FormGroupModel } from '../sign-in/sign-in.component';\nimport { forgotPasswordMethod, MForgotPassword, validateRequestModal } from 'cloud-ide-lms-model';\nimport { CloudIdeAuthService } from '../../cloud-ide-auth.service';\nimport { CideEleButtonComponent, CideInputComponent } from 'cloud-ide-element';\n\n@Component({\n selector: 'cide-auth-forgot-password',\n standalone: true,\n imports: [CideInputComponent, ReactiveFormsModule, CommonModule, CideEleButtonComponent],\n templateUrl: './forgot-password.component.html',\n styleUrl: './forgot-password.component.css'\n})\nexport class CideAuthForgotPasswordComponent {\n public setup_param = { form_loading: false };\n public forgotPassswordForm: FormGroupModel<MForgotPassword>;\n public erro_message = \"\";\n\n private authService = inject(CloudIdeAuthService);\n private route = inject(Router);\n\n constructor() {\n\n this.forgotPassswordForm = new FormGroup({\n custom_forgot_password_method: new FormControl<forgotPasswordMethod>('username'),\n user_username: new FormControl(''),\n user_emailid: new FormControl(''),\n user_mobileno: new FormControl(),\n }) as unknown as FormGroupModel<MForgotPassword>;\n }\n\n onForgotPasssword() {\n if (this.forgotPassswordForm.valid) {\n this.setup_param.form_loading = true;\n const validate = validateRequestModal(new MForgotPassword(this.forgotPassswordForm?.value as MForgotPassword));\n console.log(validate)\n if(validate === true){\n this.authService.forgotPassword(this.forgotPassswordForm?.value as MForgotPassword)?.subscribe({\n next: (response) => {\n if (response?.success === true) {\n this.setup_param.form_loading = false;\n this.route.navigate(['auth', 'sign-in'])\n }\n },\n error: (error) => {\n this.setup_param.form_loading = false;\n this.erro_message = error?.error?.message;\n console.log(error)\n setTimeout(() => {\n this.erro_message = \"\"\n }, 3000)\n }\n });\n } else {\n this.setup_param.form_loading = false;\n this.erro_message = validate.first;\n setTimeout(() => {\n this.erro_message = \"\"\n }, 3000)\n }\n }\n }\n}","<!-- https://play.tailwindcss.com/lfO85drpUy -->\n<!-- Main Div Outer Div-->\n<div class=\"cide-font-poppins tw-flex tw-min-h-screen tw-w-full tw-bg-gray-50 tw-py-3\">\n <!-- Forrm Wrapper -->\n <div class=\"tw-m-auto tw-w-96 tw-rounded-2xl tw-bg-white tw-py-6 tw-shadow-xl\">\n <!-- Logo Wrapper -->\n <div class=\"tw-m-auto tw-h-32 tw-w-64 tw-text-center\">\n <img src=\"https://console.cloudidesys.com/assets/Cloud%20IDE%20Logo%20Dark.png\" class=\"tw-m-auto tw-h-full\"\n alt=\"Cloud IDE Logo\" />\n </div> <!-- Entity name here -->\n <div class=\"tw-my-2 tw-text-center tw-text-xl tw-font-semibold\">Forgot Password</div>\n <!-- Error Logger -->\n <div class=\"tw-w-full tw-select-none tw-py-1 tw-text-center tw-text-red-500 tw-h-4 tw-text-sm\">{{erro_message}}</div>\n \n <!-- section for controls -->\n <form [formGroup]=\"forgotPassswordForm\" (ngSubmit)=\"onForgotPasssword()\" novalidate>\n <div class=\"tw-m-auto tw-pb-3 tw-pt-3\">\n <!-- Username -->\n <div class=\"tw-m-auto tw-w-80\">\n <cide-ele-input id=\"user_username\" formControlName=\"user_username\"></cide-ele-input>\n </div> <!-- Forgot Password button -->\n <div class=\"tw-w-80 tw-m-auto tw-mt-3\">\n <button cideEleButton id=\"reset_password_link_button\" [loading]=\"setup_param.form_loading\" [disabled]=\"!forgotPassswordForm.valid\">Reset Password</button>\n </div>\n </div>\n </form>\n </div>\n </div>","import { Component, inject, input, OnInit } from '@angular/core';\nimport { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { loginMethod, MLogin } from 'cloud-ide-lms-model';\nimport { Router, RouterLink, ActivatedRoute } from '@angular/router';\nimport { CloudIdeAuthService } from '../../cloud-ide-auth.service';\nimport { CideEleButtonComponent, CideInputComponent } from 'cloud-ide-element';\n// import { CideLytSharedWrapperComponent, CideLytSharedWrapperSetupParam, AppStateHelperService } from 'cloud-ide-layout';\n\nexport type FormGroupModel<T> = FormGroup<{\n [K in keyof T]: FormControl<T[K]>\n}>\n\n@Component({\n selector: 'cide-auth-sign-in',\n standalone: true,\n imports: [CideInputComponent, ReactiveFormsModule, CommonModule, CideEleButtonComponent, RouterLink],\n templateUrl: './sign-in.component.html',\n styleUrl: './sign-in.component.css'\n})\nexport class CideAuthSignInComponent implements OnInit {\n // public override shared_wrapper_setup_param = input<Partial<CideLytSharedWrapperSetupParam>>({\n // sypg_page_code: \"auth_sign_in\"\n // });\n public setup_param = { form_loading: false };\n public loginForm: FormGroupModel<MLogin>;\n public erro_message = \"\";\n private returnUrl: string = '/control-panel'; // Default return URL\n private router = inject(Router);\n private activatedRoute = inject(ActivatedRoute);\n private authService = inject(CloudIdeAuthService);\n // private appStateService = inject(AppStateHelperService);\n constructor(\n ) {\n // super();\n\n this.loginForm = new FormGroup({\n custom_login_method: new FormControl<loginMethod>('pass'),\n user_username: new FormControl(''),\n user_password: new FormControl(''),\n mpin_pin: new FormControl(''),\n stay_sign_in: new FormControl(true)\n }) as unknown as FormGroupModel<MLogin>;\n }\n\n ngOnInit(): void {\n // super.ngOnInit();\n\n // Get return URL from route parameters or default to '/control-panel'\n this.returnUrl = this.activatedRoute.snapshot.queryParams['returnUrl'] || 'control-panel';\n\n // If user is already authenticated, redirect to the return URL\n if (this.authService.isAuthenticated() && !this.authService.isTokenExpired()) {\n this.router.navigateByUrl(this.returnUrl);\n }\n }\n\n onSignIn(): void {\n if (this.loginForm.valid) {\n this.setup_param.form_loading = true;\n this.authService.signIn(this.loginForm?.value as MLogin)?.subscribe({\n next: async (response) => {\n if (response?.success === true) {\n // Store user data in auth service\n this.authService.storeUserData(response?.data?.auth_user_mst || {});\n\n // Synchronize AppStateService with the same user data \n // this.appStateService.setUser(response?.data?.auth_user_mst || null);\n\n // // Store active entity data\n // this.appStateService.setActiveEntity(response?.data?.core_system_entity || null);\n\n // Store token through the service setter which saves to localStorage\n this.authService.auth_token = (response?.token || '');\n console.log(response?.token);\n\n // Navigate to the return URL or control panel\n await new Promise(resolve => setTimeout(resolve, 2000));\n this.router.navigateByUrl(this.returnUrl);\n }\n },\n error: (error) => {\n this.setup_param.form_loading = false;\n this.erro_message = error?.error?.message;\n console.log(error);\n // Modern ES2022+ pattern: Use Promise-based delay\n const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));\n delay(3000).then(() => {\n this.erro_message = \"\";\n });\n }\n });\n }\n }\n}","<!-- https://play.tailwindcss.com/lfO85drpUy -->\n<!-- Main Div Outer Div-->\n<div class=\"cide-font-poppins tw-flex tw-min-h-screen tw-w-full tw-bg-gray-50 tw-py-3\">\n <!-- Login Forrm Wrapper -->\n <div class=\"tw-m-auto tw-w-96 tw-rounded-2xl tw-bg-white tw-py-6 tw-shadow-xl\">\n <!-- Logo Wrapper -->\n <div class=\"tw-m-auto tw-h-32 tw-w-64 tw-text-center\">\n <img src=\"https://console.cloudidesys.com/assets/Cloud%20IDE%20Logo%20Dark.png\" class=\"tw-m-auto tw-h-full\"\n alt=\"Cloud IDE Logo\" />\n </div> <!-- Entity name here -->\n <div class=\"tw-my-2 tw-text-center tw-text-xl tw-font-semibold\">SignIn to CloudIDE sys</div>\n <!-- Error Logger -->\n <div class=\"tw-w-full tw-select-none tw-py-1 tw-text-center tw-text-red-500 tw-h-4 tw-text-sm\">{{erro_message}}</div>\n \n <!-- section for controls -->\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSignIn()\" novalidate>\n <div class=\"tw-m-auto tw-pb-3 tw-pt-3\">\n <!-- Username -->\n <div class=\"tw-m-auto tw-w-80\">\n <cide-ele-input id=\"user_username\" formControlName=\"user_username\"></cide-ele-input>\n </div>\n <!-- Password -->\n <div class=\"tw-m-auto tw-mt-4 tw-w-80\">\n <cide-ele-input id=\"user_password_mpin\" formControlName=\"user_password\"></cide-ele-input>\n </div>\n <!-- Forgot password -->\n <div class=\"tw-m-auto tw-mt-3 tw-flex tw-w-80 tw-justify-between\">\n <div>\n <cide-ele-input id=\"stay_sign_in\" formControlName=\"stay_sign_in\"></cide-ele-input>\n </div>\n <div>\n <a routerLink=\"/auth/forgot-password\" class=\"tw-text-blue-700\">Forgot Password?</a>\n </div>\n </div> <!-- Sign in button -->\n <div class=\"tw-w-80 tw-m-auto tw-mt-3\">\n <button type=\"submit\" class=\"tw-w-full\" cideEleButton id=\"stay_sin_button\" [loading]=\"setup_param.form_loading\" [disabled]=\"!loginForm.valid\">a</button>\n </div>\n </div>\n </form>\n </div>\n</div>","import { Route } from '@angular/router';\r\nimport { CideAuthSignInComponent } from './auth/sign-in/sign-in.component';\r\n\r\nexport const authRoutes: Route = {\r\n path: \"auth\",\r\n loadComponent: () => import('./cloud-ide-auth.component').then(c => c.CloudIdeAuthComponent),\r\n children: [\r\n {\r\n path: \"\",\r\n pathMatch: 'full',\r\n redirectTo: 'sign-in'\r\n },\r\n {\r\n path: \"sign-in\",\r\n // loadComponent: () => import('./auth/sign-in/sign-in.component').then(c => c.CideAuthSignInComponent)\r\n component: CideAuthSignInComponent,\r\n },\r\n {\r\n path: \"forgot-password\",\r\n loadComponent: () => import('./auth/forgot-password/forgot-password.component').then(c => c.CideAuthForgotPasswordComponent)\r\n },\r\n {\r\n path: \"reset-password/:rout_token\",\r\n loadComponent: () => import('./auth/reset-password/reset-password.component').then(c => c.CideAuthResetPasswordComponent)\r\n }\r\n ]\r\n}\r\n","import { inject } from '@angular/core';\r\nimport { CanActivateFn, Router } from '@angular/router';\r\nimport { CloudIdeAuthService } from '../cloud-ide-auth.service';\r\n// import { AppStateHelperService } from 'cloud-ide-layout';\r\n\r\nexport const authGuard: CanActivateFn = (route, state) => {\r\n const authService = inject(CloudIdeAuthService);\r\n // const appState = inject(AppStateHelperService);\r\n const router = inject(Router);\r\n \r\n // Refresh auth state to make sure it's current\r\n authService.refreshAuthState();\r\n \r\n // // Refresh app state from localStorage to ensure synchronization\r\n // appState.refreshFromLocalStorage();\r\n \r\n // // Check if user is authenticated using app state (modern approach)\r\n // if (appState.isUserAuthenticated() && !authService.isTokenExpired()) {\r\n // return true;\r\n // }\r\n \r\n // Redirect to login page with the intended destination\r\n router.navigate(['/auth/sign-in'], { \r\n queryParams: { returnUrl: state.url }\r\n });\r\n \r\n return false;\r\n};\r\n","/*\n * Public API Surface of cloud-ide-auth\n */\n\nexport * from './lib/cloud-ide-auth.service';\nexport * from './lib/cloud-ide-auth.component';\nexport * from './lib/auth/forgot-password/forgot-password.component';\nexport * from './lib/cloud-ide-auth.routes';\nexport * from './lib/guards/auth.guard';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;MAYa,mBAAmB,CAAA;AACvB,IAAA,aAAa,GAAiC,IAAI,eAAe,CAAC,EAAE,CAAC;IACpE,WAAW,GAAW,EAAE;;IAGf,iBAAiB,GAAG,iBAAiB;IACrC,gBAAgB,GAAG,gBAAgB;;AAG5C,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AAEjC,IAAA,WAAA,GAAA;;QAEE,IAAI,CAAC,uBAAuB,EAAE;;AAGhC;;AAEG;IACK,uBAAuB,GAAA;AAC7B,QAAA,IAAI;YACF,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,YAAY,KAAK,WAAW;;AAC3E,QAAA,MAAM;AACN,YAAA,OAAO,KAAK;;;;AAKhB,IAAA,IAAI,UAAU,GAAA;QACZ,OAAO,IAAI,CAAC,WAAW;;IAGzB,IAAI,UAAU,CAAC,KAAa,EAAA;AAC1B,QAAA,IAAI,CAAC,WAAW,GAAG,KAAK;AACxB,QAAA,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE;YACnC;;QAEF,IAAI,KAAK,EAAE;YACT,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC;;aAC9C;AACL,YAAA,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC;;;;IAK3C,uBAAuB,GAAA;AAC7B,QAAA,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE;YACnC;;AAGF,QAAA,IAAI;;YAEF,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC;YAChE,IAAI,WAAW,EAAE;AACf,gBAAA,IAAI,CAAC,WAAW,GAAG,WAAW;;;YAIhC,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,gBAA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G,MAAM,CAAC,mBAAmB,CAAC;;AAE/C,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;IAG7B,WAAW,CAAC,gBAAgB,EAAE;;;;;;;;AAW9B,IAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,EAAE;AACjC,QAAA,WAAW,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG;AACpC,KAAA,CAAC;AAEF,IAAA,OAAO,KAAK;AACd;;AC3BA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cloud-ide-auth.mjs","sources":["../../../projects/cloud-ide-auth/src/lib/cloud-ide-auth.service.ts","../../../projects/cloud-ide-auth/src/lib/cloud-ide-auth.component.ts","../../../projects/cloud-ide-auth/src/lib/auth/forgot-password/forgot-password.component.ts","../../../projects/cloud-ide-auth/src/lib/auth/forgot-password/forgot-password.component.html","../../../projects/cloud-ide-auth/src/lib/cloud-ide-auth.routes.ts","../../../projects/cloud-ide-auth/src/lib/guards/auth.guard.ts","../../../projects/cloud-ide-auth/src/public-api.ts","../../../projects/cloud-ide-auth/src/cloud-ide-auth.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport {\n authRoutesUrl, cidePath, hostManagerRoutesUrl, AuthUserMst,\n loginControllerResponse, MLogin, MForgotPassword, ForgotPasswordControllerResponse,\n MResetPassword, ResetPasswordControllerResponse\n} from 'cloud-ide-lms-model';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { IAuthService } from 'cloud-ide-shared';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CloudIdeAuthService implements IAuthService {\n public auth_user_mst: BehaviorSubject<AuthUserMst> = new BehaviorSubject({});\n private _auth_token: string = \"\";\n\n // Storage keys\n private readonly TOKEN_STORAGE_KEY = 'cide_auth_token';\n private readonly USER_STORAGE_KEY = 'cide_auth_user';\n\n // Modern Angular v20 dependency injection pattern\n private http = inject(HttpClient);\n\n constructor() {\n // Modern Angular v20 pattern: Use constructor for initialization only\n this.loadAuthDataFromStorage();\n }\n\n /**\n * Check if localStorage is available (browser environment)\n */\n private isLocalStorageAvailable(): boolean {\n try {\n return typeof window !== 'undefined' && typeof localStorage !== 'undefined';\n } catch {\n return false;\n }\n }\n\n // Getter and setter for auth_token with localStorage persistence\n get auth_token(): string {\n return this._auth_token;\n }\n\n set auth_token(value: string) {\n this._auth_token = value;\n if (!this.isLocalStorageAvailable()) {\n return;\n }\n if (value) {\n localStorage.setItem(this.TOKEN_STORAGE_KEY, value);\n } else {\n localStorage.removeItem(this.TOKEN_STORAGE_KEY);\n }\n }\n\n // Load authentication data from localStorage on service initialization\n private loadAuthDataFromStorage(): void {\n if (!this.isLocalStorageAvailable()) {\n return;\n }\n\n try {\n // Load token\n const storedToken = localStorage.getItem(this.TOKEN_STORAGE_KEY);\n if (storedToken) {\n this._auth_token = storedToken;\n }\n\n // Load user data\n const storedUserData = localStorage.getItem(this.USER_STORAGE_KEY);\n if (storedUserData) {\n const userData = JSON.parse(storedUserData);\n this.auth_user_mst.next(userData);\n }\n } catch (error) {\n console.error('Error loading auth data from storage:', error);\n }\n }\n\n // Store user data in localStorage\n public storeUserData(userData: AuthUserMst): void {\n if (userData) {\n this.auth_user_mst.next(userData);\n if (this.isLocalStorageAvailable()) {\n localStorage.setItem(this.USER_STORAGE_KEY, JSON.stringify(userData));\n }\n }\n }\n\n signIn(body: MLogin): Observable<loginControllerResponse> {\n if (body?.user_password) {\n if (body?.user_password?.length <= 6) {\n body.custom_login_method = \"mpin\";\n body.mpin_pin = body?.user_password;\n body.user_password = \"\";\n }\n }\n return this.http?.post(cidePath?.join([hostManagerRoutesUrl?.cideSuiteHost, authRoutesUrl?.module, authRoutesUrl?.signIn]), body);\n }\n\n forgotPassword(body: MForgotPassword): Observable<ForgotPasswordControllerResponse> {\n return this.http?.post(cidePath?.join([hostManagerRoutesUrl?.cideSuiteHost, authRoutesUrl?.module, authRoutesUrl?.forgotPassword]), body);\n }\n\n resetPassword(body: MResetPassword): Observable<ResetPasswordControllerResponse> {\n const payload = new MResetPassword(body);\n if (payload?.Validate) {\n payload?.Validate();\n }\n return this.http?.post(cidePath?.join([hostManagerRoutesUrl?.cideSuiteHost, authRoutesUrl?.module, authRoutesUrl?.resetPassword]), body);\n }\n\n // Sign out the user and clear all stored auth data\n signOut(): void {\n // Clear token and user data from memory\n this._auth_token = \"\";\n this.auth_user_mst.next({});\n\n // Clear stored data\n if (this.isLocalStorageAvailable()) {\n localStorage.removeItem(this.TOKEN_STORAGE_KEY);\n localStorage.removeItem(this.USER_STORAGE_KEY);\n }\n }\n\n // Check if user is authenticated\n isAuthenticated(): boolean {\n return !!this._auth_token;\n }\n\n // Get current user data \n getCurrentUser(): AuthUserMst {\n return this.auth_user_mst.getValue();\n }\n\n // Check if token is expired\n isTokenExpired(): boolean {\n try {\n if (!this._auth_token) {\n return true;\n }\n\n // Extract the payload from the JWT token\n const tokenParts = this._auth_token.split('.');\n if (tokenParts.length !== 3) {\n return true; // Not a valid JWT token\n }\n\n const payload = JSON.parse(atob(tokenParts[1]));\n\n // Check expiration time\n const expiration = payload.exp * 1000; // Convert seconds to milliseconds\n return Date.now() >= expiration;\n } catch (error) {\n console.error('Error checking token expiration:', error);\n return true; // Assume expired if there's an error\n }\n }\n\n // Refresh auth data if needed based on stored data\n refreshAuthState(): void {\n // If we have a token but no user data, try to load user data\n if (this._auth_token && this.auth_user_mst && Object.keys(this.auth_user_mst.getValue()).length === 0 && this.isLocalStorageAvailable()) {\n const storedUserData = localStorage.getItem(this.USER_STORAGE_KEY);\n if (storedUserData) {\n try {\n const userData = JSON.parse(storedUserData);\n this.auth_user_mst.next(userData);\n } catch (error) {\n console.error('Error parsing stored user data:', error);\n }\n }\n }\n\n // If token is expired, sign out\n if (this.isTokenExpired()) {\n this.signOut();\n }\n }\n}\n","import { Component } from '@angular/core';\r\nimport { RouterOutlet } from '@angular/router';\r\n\r\n@Component({\r\n selector: 'cide-auth-wrapper',\r\n standalone: true,\r\n imports: [RouterOutlet],\r\n template: `\r\n <router-outlet></router-outlet>\r\n `,\r\n styles: ``\r\n})\r\nexport class CloudIdeAuthComponent {\r\n\r\n}\r\n","import { Component, inject } from '@angular/core';\nimport { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { Router } from '@angular/router';\nimport { FormGroupModel } from '../sign-in/sign-in.component';\nimport { forgotPasswordMethod, MForgotPassword, validateRequestModal } from 'cloud-ide-lms-model';\nimport { CloudIdeAuthService } from '../../cloud-ide-auth.service';\nimport { CideEleButtonComponent, CideInputComponent } from 'cloud-ide-element';\n\n@Component({\n selector: 'cide-auth-forgot-password',\n standalone: true,\n imports: [CideInputComponent, ReactiveFormsModule, CommonModule, CideEleButtonComponent],\n templateUrl: './forgot-password.component.html',\n styleUrl: './forgot-password.component.css'\n})\nexport class CideAuthForgotPasswordComponent {\n public setup_param = { form_loading: false };\n public forgotPassswordForm: FormGroupModel<MForgotPassword>;\n public erro_message = \"\";\n\n private authService = inject(CloudIdeAuthService);\n private route = inject(Router);\n\n constructor() {\n\n this.forgotPassswordForm = new FormGroup({\n custom_forgot_password_method: new FormControl<forgotPasswordMethod>('username'),\n user_username: new FormControl(''),\n user_emailid: new FormControl(''),\n user_mobileno: new FormControl(),\n }) as unknown as FormGroupModel<MForgotPassword>;\n }\n\n onForgotPasssword() {\n if (this.forgotPassswordForm.valid) {\n this.setup_param.form_loading = true;\n const validate = validateRequestModal(new MForgotPassword(this.forgotPassswordForm?.value as MForgotPassword));\n console.log(validate)\n if(validate === true){\n this.authService.forgotPassword(this.forgotPassswordForm?.value as MForgotPassword)?.subscribe({\n next: (response) => {\n if (response?.success === true) {\n this.setup_param.form_loading = false;\n this.route.navigate(['auth', 'sign-in'])\n }\n },\n error: (error) => {\n this.setup_param.form_loading = false;\n this.erro_message = error?.error?.message;\n console.log(error)\n setTimeout(() => {\n this.erro_message = \"\"\n }, 3000)\n }\n });\n } else {\n this.setup_param.form_loading = false;\n this.erro_message = validate.first;\n setTimeout(() => {\n this.erro_message = \"\"\n }, 3000)\n }\n }\n }\n}","<!-- https://play.tailwindcss.com/lfO85drpUy -->\n<!-- Main Div Outer Div-->\n<div class=\"cide-font-poppins tw-flex tw-min-h-screen tw-w-full tw-bg-gray-50 tw-py-3\">\n <!-- Forrm Wrapper -->\n <div class=\"tw-m-auto tw-w-96 tw-rounded-2xl tw-bg-white tw-py-6 tw-shadow-xl\">\n <!-- Logo Wrapper -->\n <div class=\"tw-m-auto tw-h-32 tw-w-64 tw-text-center\">\n <img src=\"https://console.cloudidesys.com/assets/Cloud%20IDE%20Logo%20Dark.png\" class=\"tw-m-auto tw-h-full\"\n alt=\"Cloud IDE Logo\" />\n </div> <!-- Entity name here -->\n <div class=\"tw-my-2 tw-text-center tw-text-xl tw-font-semibold\">Forgot Password</div>\n <!-- Error Logger -->\n <div class=\"tw-w-full tw-select-none tw-py-1 tw-text-center tw-text-red-500 tw-h-4 tw-text-sm\">{{erro_message}}</div>\n \n <!-- section for controls -->\n <form [formGroup]=\"forgotPassswordForm\" (ngSubmit)=\"onForgotPasssword()\" novalidate>\n <div class=\"tw-m-auto tw-pb-3 tw-pt-3\">\n <!-- Username -->\n <div class=\"tw-m-auto tw-w-80\">\n <cide-ele-input id=\"user_username\" formControlName=\"user_username\"></cide-ele-input>\n </div> <!-- Forgot Password button -->\n <div class=\"tw-w-80 tw-m-auto tw-mt-3\">\n <button cideEleButton id=\"reset_password_link_button\" [loading]=\"setup_param.form_loading\" [disabled]=\"!forgotPassswordForm.valid\">Reset Password</button>\n </div>\n </div>\n </form>\n </div>\n </div>","import { Route } from '@angular/router';\r\n\r\nexport const authRoutes: Route = {\r\n path: \"auth\",\r\n loadComponent: () => import('./cloud-ide-auth.component').then(c => c.CloudIdeAuthComponent),\r\n children: [\r\n {\r\n path: \"\",\r\n pathMatch: 'full',\r\n redirectTo: 'sign-in'\r\n },\r\n {\r\n path: \"sign-in\",\r\n loadComponent: () => import('./auth/sign-in/sign-in.component').then(c => c.CideAuthSignInComponent)\r\n },\r\n {\r\n path: \"forgot-password\",\r\n loadComponent: () => import('./auth/forgot-password/forgot-password.component').then(c => c.CideAuthForgotPasswordComponent)\r\n },\r\n {\r\n path: \"reset-password/:rout_token\",\r\n loadComponent: () => import('./auth/reset-password/reset-password.component').then(c => c.CideAuthResetPasswordComponent)\r\n }\r\n ]\r\n}\r\n","import { inject } from '@angular/core';\r\nimport { CanActivateFn, Router } from '@angular/router';\r\nimport { IAuthService, AUTH_SERVICE_TOKEN, IAppStateService, APP_STATE_SERVICE_TOKEN } from 'cloud-ide-shared';\r\n\r\nexport const authGuard: CanActivateFn = (route, state) => {\r\n const authService = inject(AUTH_SERVICE_TOKEN) as IAuthService;\r\n const appState = inject(APP_STATE_SERVICE_TOKEN) as IAppStateService;\r\n const router = inject(Router);\r\n \r\n // Refresh auth state to make sure it's current\r\n authService.refreshAuthState();\r\n \r\n // Refresh app state from localStorage to ensure synchronization\r\n appState.refreshFromLocalStorage();\r\n \r\n // Check if user is authenticated using app state (modern approach)\r\n if (appState.isUserAuthenticated() && !authService.isTokenExpired()) {\r\n return true;\r\n }\r\n \r\n // Redirect to login page with the intended destination\r\n router.navigate(['/auth/sign-in'], { \r\n queryParams: { returnUrl: state.url }\r\n });\r\n \r\n return false;\r\n};\r\n","/*\n * Public API Surface of cloud-ide-auth\n */\n\nexport * from './lib/cloud-ide-auth.service';\nexport * from './lib/cloud-ide-auth.component';\nexport * from './lib/auth/forgot-password/forgot-password.component';\nexport * from './lib/cloud-ide-auth.routes';\nexport * from './lib/guards/auth.guard';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;MAaa,mBAAmB,CAAA;AACvB,IAAA,aAAa,GAAiC,IAAI,eAAe,CAAC,EAAE,CAAC;IACpE,WAAW,GAAW,EAAE;;IAGf,iBAAiB,GAAG,iBAAiB;IACrC,gBAAg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A,MAAM,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAiB;AAC9D,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,uBAAuB,CAAqB;AACpE,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;IAG7B,WAAW,CAAC,gBAAgB,EAAE;;IAG9B,QAAQ,CAAC,uBAAuB,EAAE;;IAGlC,IAAI,QAAQ,CAAC,mBAAmB,EAAE,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,EAAE;AACnE,QAAA,OAAO,IAAI;;;AAIb,IAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,EAAE;AACjC,QAAA,WAAW,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG;AACpC,KAAA,CAAC;AAEF,IAAA,OAAO,KAAK;AACd;;AC1BA;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AuthUserMst, MLogin, loginControllerResponse, MForgotPassword, ForgotPasswordControllerResponse, MResetPassword, ResetPasswordControllerResponse } from 'cloud-ide-lms-model';
|
|
2
2
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
|
+
import { IAuthService } from 'cloud-ide-shared';
|
|
3
4
|
import * as i0 from '@angular/core';
|
|
4
5
|
import { FormGroup, FormControl } from '@angular/forms';
|
|
5
6
|
import { Route, CanActivateFn } from '@angular/router';
|
|
6
7
|
|
|
7
|
-
declare class CloudIdeAuthService {
|
|
8
|
+
declare class CloudIdeAuthService implements IAuthService {
|
|
8
9
|
auth_user_mst: BehaviorSubject<AuthUserMst>;
|
|
9
10
|
private _auth_token;
|
|
10
11
|
private readonly TOKEN_STORAGE_KEY;
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloud-ide-auth",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^20.1.0",
|
|
6
|
-
"@angular/core": "^20.1.0"
|
|
6
|
+
"@angular/core": "^20.1.0",
|
|
7
|
+
"cloud-ide-shared": "^1.0.0"
|
|
7
8
|
},
|
|
8
9
|
"dependencies": {
|
|
9
10
|
"tslib": "^2.3.0"
|