@sneat/auth-ui 0.26.0 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/auth-menu-item/auth-menu-item.component.js +14 -9
- package/esm2022/lib/components/auth-menu-item/auth-menu-item.component.js.map +1 -1
- package/esm2022/lib/components/user-auth-providers/user-auth-accounts.component.js +11 -8
- package/esm2022/lib/components/user-auth-providers/user-auth-accounts.component.js.map +1 -1
- package/esm2022/lib/components/user-auth-providers/user-auth-provider-status.js +22 -14
- package/esm2022/lib/components/user-auth-providers/user-auth-provider-status.js.map +1 -1
- package/esm2022/lib/components/user-required-fields/user-required-fields-modal.component.js +10 -12
- package/esm2022/lib/components/user-required-fields/user-required-fields-modal.component.js.map +1 -1
- package/esm2022/lib/components/user-required-fields/user-required-fields.service.js +4 -4
- package/esm2022/lib/components/user-required-fields/user-required-fields.service.js.map +1 -1
- package/esm2022/lib/pages/login-page/email-login-form/email-login-form.component.js +24 -14
- package/esm2022/lib/pages/login-page/email-login-form/email-login-form.component.js.map +1 -1
- package/esm2022/lib/pages/login-page/login-page.component.js +15 -11
- package/esm2022/lib/pages/login-page/login-page.component.js.map +1 -1
- package/esm2022/lib/pages/login-page/login-with-telegram.component.js +22 -26
- package/esm2022/lib/pages/login-page/login-with-telegram.component.js.map +1 -1
- package/esm2022/lib/pages/login-page/sneat-auth-with-telegram.service.js +3 -3
- package/esm2022/lib/pages/sign-in-from-email-link/sign-in-from-email-link-page.component.js +10 -7
- package/esm2022/lib/pages/sign-in-from-email-link/sign-in-from-email-link-page.component.js.map +1 -1
- package/esm2022/lib/pages/sneat-auth-routing.module.js +4 -4
- package/esm2022/lib/pipes/person-names.pipe.js +3 -3
- package/lib/components/user-required-fields/user-required-fields-modal.component.d.ts +2 -2
- package/lib/pages/login-page/email-login-form/email-login-form.component.d.ts +2 -2
- package/lib/pages/login-page/login-with-telegram.component.d.ts +6 -6
- package/package.json +4 -4
- package/tsconfig.lib.prod.tsbuildinfo +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
|
-
import { Component, ElementRef,
|
|
2
|
+
import { Component, ElementRef, inject, ChangeDetectionStrategy, input } from '@angular/core';
|
|
3
3
|
import { SneatAuthWithTelegramService, } from './sneat-auth-with-telegram.service';
|
|
4
4
|
import { TelegramLoginConfig, resolveTelegramBotID, } from './telegram-login-config';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
@@ -13,16 +13,21 @@ export class LoginWithTelegramComponent {
|
|
|
13
13
|
this.telegramLoginConfig = inject(TelegramLoginConfig, {
|
|
14
14
|
optional: true,
|
|
15
15
|
});
|
|
16
|
-
this.isUserAuthenticated = false
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
this.
|
|
16
|
+
this.isUserAuthenticated = input(false, /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "isUserAuthenticated" }] : /* istanbul ignore next */ []));
|
|
18
|
+
this.botID = input(resolveTelegramBotID(this.telegramLoginConfig, location.hostname), /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "botID" }] : /* istanbul ignore next */ []));
|
|
20
|
+
this.size = input('large', /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
22
|
+
this.requestAccess = input('write', /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "requestAccess" }] : /* istanbul ignore next */ []));
|
|
24
|
+
this.userPic = input(true, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "userPic" }] : /* istanbul ignore next */ []));
|
|
21
26
|
const authWithTelegram = this.authWithTelegram;
|
|
22
27
|
authWithTelegramService = authWithTelegram;
|
|
23
28
|
}
|
|
24
29
|
ngOnInit() {
|
|
25
|
-
const botID = this.botID;
|
|
30
|
+
const botID = this.botID();
|
|
26
31
|
if (botID) {
|
|
27
32
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
28
33
|
// @ts-ignore
|
|
@@ -31,14 +36,14 @@ export class LoginWithTelegramComponent {
|
|
|
31
36
|
// After a successful authorization, the widget returns data
|
|
32
37
|
// by calling the callback function data-onauth with the JSON-object containing
|
|
33
38
|
// id, first_name, last_name, username, photo_url, auth_date and hash fields.
|
|
34
|
-
authWithTelegramService.loginWithTelegram(botID, tgAuthData, this.isUserAuthenticated);
|
|
39
|
+
authWithTelegramService.loginWithTelegram(botID, tgAuthData, this.isUserAuthenticated());
|
|
35
40
|
};
|
|
36
41
|
const script = this.document.createElement('script');
|
|
37
42
|
script.src = 'https://telegram.org/js/telegram-widget.js?22';
|
|
38
43
|
script.setAttribute('data-telegram-login', botID);
|
|
39
|
-
script.setAttribute('data-request-access', this.requestAccess);
|
|
40
|
-
script.setAttribute('data-size', this.size);
|
|
41
|
-
if (!this.userPic) {
|
|
44
|
+
script.setAttribute('data-request-access', this.requestAccess());
|
|
45
|
+
script.setAttribute('data-size', this.size());
|
|
46
|
+
if (!this.userPic()) {
|
|
42
47
|
script.setAttribute('data-userpic', 'false');
|
|
43
48
|
}
|
|
44
49
|
// https://core.telegram.org/widgets/login#receiving-authorization-data
|
|
@@ -49,8 +54,8 @@ export class LoginWithTelegramComponent {
|
|
|
49
54
|
this.el.nativeElement.appendChild(script);
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
53
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
57
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: LoginWithTelegramComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
58
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: LoginWithTelegramComponent, isStandalone: true, selector: "sneat-login-with-telegram", inputs: { isUserAuthenticated: { classPropertyName: "isUserAuthenticated", publicName: "isUserAuthenticated", isSignal: true, isRequired: false, transformFunction: null }, botID: { classPropertyName: "botID", publicName: "botID", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, requestAccess: { classPropertyName: "requestAccess", publicName: "requestAccess", isSignal: true, isRequired: false, transformFunction: null }, userPic: { classPropertyName: "userPic", publicName: "userPic", isSignal: true, isRequired: false, transformFunction: null } }, providers: [SneatAuthWithTelegramService], ngImport: i0, template: `
|
|
54
59
|
<!--
|
|
55
60
|
<script
|
|
56
61
|
async
|
|
@@ -61,13 +66,14 @@ export class LoginWithTelegramComponent {
|
|
|
61
66
|
data-request-access="write"
|
|
62
67
|
></script>
|
|
63
68
|
-->
|
|
64
|
-
`, isInline: true }); }
|
|
69
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
65
70
|
}
|
|
66
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: LoginWithTelegramComponent, decorators: [{
|
|
67
72
|
type: Component,
|
|
68
73
|
args: [{
|
|
69
74
|
providers: [SneatAuthWithTelegramService],
|
|
70
75
|
selector: 'sneat-login-with-telegram',
|
|
76
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
71
77
|
template: `
|
|
72
78
|
<!--
|
|
73
79
|
<script
|
|
@@ -81,15 +87,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
81
87
|
-->
|
|
82
88
|
`,
|
|
83
89
|
}]
|
|
84
|
-
}], ctorParameters: () => [], propDecorators: { isUserAuthenticated: [{
|
|
85
|
-
type: Input
|
|
86
|
-
}], botID: [{
|
|
87
|
-
type: Input
|
|
88
|
-
}], size: [{
|
|
89
|
-
type: Input
|
|
90
|
-
}], requestAccess: [{
|
|
91
|
-
type: Input
|
|
92
|
-
}], userPic: [{
|
|
93
|
-
type: Input
|
|
94
|
-
}] } });
|
|
90
|
+
}], ctorParameters: () => [], propDecorators: { isUserAuthenticated: [{ type: i0.Input, args: [{ isSignal: true, alias: "isUserAuthenticated", required: false }] }], botID: [{ type: i0.Input, args: [{ isSignal: true, alias: "botID", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], requestAccess: [{ type: i0.Input, args: [{ isSignal: true, alias: "requestAccess", required: false }] }], userPic: [{ type: i0.Input, args: [{ isSignal: true, alias: "userPic", required: false }] }] } });
|
|
95
91
|
//# sourceMappingURL=login-with-telegram.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-with-telegram.component.js","sourceRoot":"","sources":["../../../../../../../../libs/auth/ui/src/lib/pages/login-page/login-with-telegram.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"login-with-telegram.component.js","sourceRoot":"","sources":["../../../../../../../../libs/auth/ui/src/lib/pages/login-page/login-with-telegram.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAU,MAAM,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,EAEL,4BAA4B,GAC7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;;AAEjC,IAAI,uBAAqD,CAAC;AAmB1D,MAAM,OAAO,0BAA0B;IAQrC,qCAAqC;IACrC;QARiB,OAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;QACxB,aAA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YACjE,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAC9C,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;gBACpB,MAAM,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;YAC/C,CAAC;YACD,uEAAuE;YACvE,4DAA4D;YAC5D,+EAA+E;YAC/E,6EAA6E;YAC7E,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAC;YAC3D,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;8GAxDU,0BAA0B;kGAA1B,0BAA0B,ivBAhB1B,CAAC,4BAA4B,CAAC,0BAG/B;;;;;;;;;;;GAWT;;2FAEU,0BAA0B;kBAjBtC,SAAS;mBAAC;oBACT,SAAS,EAAE,CAAC,4BAA4B,CAAC;oBACzC,QAAQ,EAAE,2BAA2B;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,QAAQ,EAAE;;;;;;;;;;;GAWT;iBACF","sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { Component, ElementRef, OnInit, inject, ChangeDetectionStrategy, input } from '@angular/core';\nimport {\n ITelegramAuthData,\n SneatAuthWithTelegramService,\n} from './sneat-auth-with-telegram.service';\nimport {\n TelegramLoginConfig,\n resolveTelegramBotID,\n} from './telegram-login-config';\n\nlet authWithTelegramService: SneatAuthWithTelegramService;\n\n@Component({\n providers: [SneatAuthWithTelegramService],\n selector: 'sneat-login-with-telegram',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <!--\n\t\t\t\t<script\n\t\t\t\t\tasync\n\t\t\t\t\tsrc=\"https://telegram.org/js/telegram-widget.js?22\"\n\t\t\t\t\tdata-telegram-login=\"SneatBot\"\n\t\t\t\t\tdata-size=\"large\"\n\t\t\t\t\tdata-onauth=\"onTelegramAuth(user)\"\n\t\t\t\t\tdata-request-access=\"write\"\n\t\t\t\t></script>\n\t\t\t\t-->\n `,\n})\nexport class LoginWithTelegramComponent implements OnInit {\n private readonly el = inject(ElementRef);\n private readonly document = inject<Document>(DOCUMENT);\n readonly authWithTelegram = inject(SneatAuthWithTelegramService);\n private readonly telegramLoginConfig = inject(TelegramLoginConfig, {\n optional: true,\n });\n\n // TODO: Article about Telegram login\n constructor() {\n const authWithTelegram = this.authWithTelegram;\n\n authWithTelegramService = authWithTelegram;\n }\n\n public readonly isUserAuthenticated = input(false);\n\n public readonly botID = input<string>(resolveTelegramBotID(this.telegramLoginConfig, location.hostname));\n\n public readonly size = input<'small' | 'medium' | 'large'>('large');\n public readonly requestAccess = input<'write' | 'read'>('write');\n public readonly userPic = input(true);\n\n ngOnInit() {\n const botID = this.botID();\n if (botID) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n window.onTelegramAuth = (tgAuthData: ITelegramAuthData) => {\n // https://core.telegram.org/widgets/login#receiving-authorization-data\n // After a successful authorization, the widget returns data\n // by calling the callback function data-onauth with the JSON-object containing\n // id, first_name, last_name, username, photo_url, auth_date and hash fields.\n authWithTelegramService.loginWithTelegram(\n botID,\n tgAuthData,\n this.isUserAuthenticated(),\n );\n };\n\n const script = this.document.createElement('script');\n\n script.src = 'https://telegram.org/js/telegram-widget.js?22';\n script.setAttribute('data-telegram-login', botID);\n script.setAttribute('data-request-access', this.requestAccess());\n script.setAttribute('data-size', this.size());\n if (!this.userPic()) {\n script.setAttribute('data-userpic', 'false');\n }\n // https://core.telegram.org/widgets/login#receiving-authorization-data\n // After a successful authorization, the widget returns data\n // by calling the callback function data-onauth with the JSON-object containing\n // id, first_name, last_name, username, photo_url, auth_date and hash fields.\n script.setAttribute('data-onauth', 'onTelegramAuth(user)');\n this.el.nativeElement.appendChild(script);\n }\n }\n}\n"]}
|
|
@@ -22,10 +22,10 @@ export class SneatAuthWithTelegramService {
|
|
|
22
22
|
error: this.errorLogger.logErrorHandler('signInWithTelegram() error:'),
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
26
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
25
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: SneatAuthWithTelegramService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
26
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: SneatAuthWithTelegramService }); }
|
|
27
27
|
}
|
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: SneatAuthWithTelegramService, decorators: [{
|
|
29
29
|
type: Injectable
|
|
30
30
|
}] });
|
|
31
31
|
//# sourceMappingURL=sneat-auth-with-telegram.service.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, inject, signal, } from '@angular/core';
|
|
2
|
-
import { IonButton, IonCard, IonContent, IonHeader, IonIcon, IonInput, IonItem, IonLabel, IonTitle, IonToolbar, NavController, } from '@ionic/angular
|
|
2
|
+
import { IonButton, IonCard, IonContent, IonHeader, IonIcon, IonInput, IonItem, IonLabel, IonTitle, IonToolbar, NavController, } from '@ionic/angular';
|
|
3
3
|
import { SneatAuthStateService } from '@sneat/auth-core';
|
|
4
4
|
import { ErrorLogger } from '@sneat/core';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
@@ -8,9 +8,12 @@ export class SignInFromEmailLinkPageComponent {
|
|
|
8
8
|
this.errorLogger = inject(ErrorLogger);
|
|
9
9
|
this.authStateService = inject(SneatAuthStateService);
|
|
10
10
|
this.navController = inject(NavController);
|
|
11
|
-
this.email = signal('',
|
|
12
|
-
|
|
13
|
-
this.
|
|
11
|
+
this.email = signal('', /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "email" }] : /* istanbul ignore next */ []));
|
|
13
|
+
this.emailFromStorage = signal(false, /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "emailFromStorage" }] : /* istanbul ignore next */ []));
|
|
15
|
+
this.isSigning = signal(false, /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "isSigning" }] : /* istanbul ignore next */ []));
|
|
14
17
|
const email = localStorage.getItem('emailForSignIn') || '';
|
|
15
18
|
this.email.set(email);
|
|
16
19
|
this.emailFromStorage.set(!!email);
|
|
@@ -33,10 +36,10 @@ export class SignInFromEmailLinkPageComponent {
|
|
|
33
36
|
},
|
|
34
37
|
});
|
|
35
38
|
}
|
|
36
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
37
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
39
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: SignInFromEmailLinkPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
40
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: SignInFromEmailLinkPageComponent, isStandalone: true, selector: "sneat-sign-in-from-email-link-page", ngImport: i0, template: "<ion-header>\n <ion-toolbar color=\"light\">\n <ion-title>Signing in with email link</ion-title>\n </ion-toolbar>\n</ion-header>\n<ion-content>\n <ion-card>\n @if (!emailFromStorage()) {\n <p>\n Welcome to our app! For your safety please re-type your email address to\n sign-in.\n </p>\n }\n <ion-item>\n <ion-icon name=\"mail-outline\" slot=\"start\" />\n <ion-input\n label=\"Email\"\n [required]=\"true\"\n [readonly]=\"isSigning()\"\n [value]=\"email()\"\n [disabled]=\"emailFromStorage() || isSigning()\"\n />\n </ion-item>\n\n <ion-button [disabled]=\"isSigning()\" (click)=\"signIn()\">\n <ion-label>\n @if (isSigning()) {\n Signing in...\n } @else {\n Sign in\n }\n </ion-label>\n </ion-button>\n </ion-card>\n</ion-content>\n", dependencies: [{ kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"], outputs: ["ionScrollStart", "ionScroll", "ionScrollEnd"] }, { kind: "component", type: IonCard, selector: "ion-card", inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"], outputs: ["ionFocus", "ionBlur"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
38
41
|
}
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: SignInFromEmailLinkPageComponent, decorators: [{
|
|
40
43
|
type: Component,
|
|
41
44
|
args: [{ selector: 'sneat-sign-in-from-email-link-page', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
42
45
|
IonHeader,
|
package/esm2022/lib/pages/sign-in-from-email-link/sign-in-from-email-link-page.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign-in-from-email-link-page.component.js","sourceRoot":"","sources":["../../../../../../../../libs/auth/ui/src/lib/pages/sign-in-from-email-link/sign-in-from-email-link-page.component.ts","../../../../../../../../libs/auth/ui/src/lib/pages/sign-in-from-email-link/sign-in-from-email-link-page.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,OAAO,EACP,UAAU,EACV,SAAS,EACT,OAAO,EACP,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,aAAa,GACd,MAAM,
|
|
1
|
+
{"version":3,"file":"sign-in-from-email-link-page.component.js","sourceRoot":"","sources":["../../../../../../../../libs/auth/ui/src/lib/pages/sign-in-from-email-link/sign-in-from-email-link-page.component.ts","../../../../../../../../libs/auth/ui/src/lib/pages/sign-in-from-email-link/sign-in-from-email-link-page.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,OAAO,EACP,UAAU,EACV,SAAS,EACT,OAAO,EACP,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,QAAQ,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,CAAC;gBAC1B,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBACjC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,EAAE,mCAAmC,CAAC,CAAC;YACtE,CAAC;SACF,CAAC,CAAC;IACL,CAAC;8GApCU,gCAAgC;kGAAhC,gCAAgC,8FCvC7C,o3BAmCA,4CDRI,SAAS,oGACT,UAAU,mFACV,QAAQ,iFACR,UAAU,kOACV,OAAO,yLACP,OAAO,0NACP,OAAO,2JACP,QAAQ,8eACR,SAAS,sRACT,QAAQ;;2FAGC,gCAAgC;kBAjB5C,SAAS;+BACE,oCAAoC,mBAE7B,uBAAuB,CAAC,MAAM,WACtC;wBACP,SAAS;wBACT,UAAU;wBACV,QAAQ;wBACR,UAAU;wBACV,OAAO;wBACP,OAAO;wBACP,OAAO;wBACP,QAAQ;wBACR,SAAS;wBACT,QAAQ;qBACT","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n inject,\n signal,\n} from '@angular/core';\nimport {\n IonButton,\n IonCard,\n IonContent,\n IonHeader,\n IonIcon,\n IonInput,\n IonItem,\n IonLabel,\n IonTitle,\n IonToolbar,\n NavController,\n} from '@ionic/angular';\nimport { SneatAuthStateService } from '@sneat/auth-core';\nimport { ErrorLogger, IErrorLogger } from '@sneat/core';\n\n@Component({\n selector: 'sneat-sign-in-from-email-link-page',\n templateUrl: 'sign-in-from-email-link-page.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n IonHeader,\n IonToolbar,\n IonTitle,\n IonContent,\n IonCard,\n IonItem,\n IonIcon,\n IonInput,\n IonButton,\n IonLabel,\n ],\n})\nexport class SignInFromEmailLinkPageComponent {\n private readonly errorLogger = inject<IErrorLogger>(ErrorLogger);\n private readonly authStateService = inject(SneatAuthStateService);\n private readonly navController = inject(NavController);\n\n protected readonly email = signal('');\n protected readonly emailFromStorage = signal(false);\n protected readonly isSigning = signal(false);\n\n constructor() {\n const email = localStorage.getItem('emailForSignIn') || '';\n this.email.set(email);\n this.emailFromStorage.set(!!email);\n if (email) {\n this.signIn();\n }\n }\n\n public signIn(): void {\n this.isSigning.set(true);\n this.authStateService.signInWithEmailLink(this.email()).subscribe({\n next: () => {\n this.navController\n .navigateRoot('/')\n .catch(\n this.errorLogger.logErrorHandler(\n 'Failed to navigate to root page after signing in with email link',\n ),\n );\n },\n error: (err) => {\n this.isSigning.set(false);\n this.emailFromStorage.set(false);\n this.errorLogger.logError(err, 'Failed to sign in with email link');\n },\n });\n }\n}\n","<ion-header>\n <ion-toolbar color=\"light\">\n <ion-title>Signing in with email link</ion-title>\n </ion-toolbar>\n</ion-header>\n<ion-content>\n <ion-card>\n @if (!emailFromStorage()) {\n <p>\n Welcome to our app! For your safety please re-type your email address to\n sign-in.\n </p>\n }\n <ion-item>\n <ion-icon name=\"mail-outline\" slot=\"start\" />\n <ion-input\n label=\"Email\"\n [required]=\"true\"\n [readonly]=\"isSigning()\"\n [value]=\"email()\"\n [disabled]=\"emailFromStorage() || isSigning()\"\n />\n </ion-item>\n\n <ion-button [disabled]=\"isSigning()\" (click)=\"signIn()\">\n <ion-label>\n @if (isSigning()) {\n Signing in...\n } @else {\n Sign in\n }\n </ion-label>\n </ion-button>\n </ion-card>\n</ion-content>\n"]}
|
|
@@ -13,11 +13,11 @@ export const authRoutes = [
|
|
|
13
13
|
},
|
|
14
14
|
];
|
|
15
15
|
export class SneatAuthRoutingModule {
|
|
16
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
17
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
18
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
16
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: SneatAuthRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
17
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: SneatAuthRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] }); }
|
|
18
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: SneatAuthRoutingModule, imports: [RouterModule.forChild(authRoutes), RouterModule] }); }
|
|
19
19
|
}
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: SneatAuthRoutingModule, decorators: [{
|
|
21
21
|
type: NgModule,
|
|
22
22
|
args: [{
|
|
23
23
|
imports: [RouterModule.forChild(authRoutes)],
|
|
@@ -13,10 +13,10 @@ export class PersonNamesPipe {
|
|
|
13
13
|
}
|
|
14
14
|
return JSON.stringify(names);
|
|
15
15
|
}
|
|
16
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
17
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
16
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: PersonNamesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
17
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: PersonNamesPipe, isStandalone: true, name: "personNames" }); }
|
|
18
18
|
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: PersonNamesPipe, decorators: [{
|
|
20
20
|
type: Pipe,
|
|
21
21
|
args: [{ name: 'personNames' }]
|
|
22
22
|
}] });
|
|
@@ -8,7 +8,7 @@ export declare class UserRequiredFieldsModalComponent extends SneatBaseComponent
|
|
|
8
8
|
private readonly modalController;
|
|
9
9
|
private readonly userRecordService;
|
|
10
10
|
private readonly sneatUserService;
|
|
11
|
-
space: ISpaceContext
|
|
11
|
+
readonly space: import("@angular/core").InputSignal<ISpaceContext>;
|
|
12
12
|
protected readonly genders: ISelectItem[];
|
|
13
13
|
protected readonly ageGroups: ISelectItem[];
|
|
14
14
|
protected readonly firstName: FormControl<string | null>;
|
|
@@ -27,5 +27,5 @@ export declare class UserRequiredFieldsModalComponent extends SneatBaseComponent
|
|
|
27
27
|
protected save(): void;
|
|
28
28
|
protected close(): void;
|
|
29
29
|
static ɵfac: i0.ɵɵFactoryDeclaration<UserRequiredFieldsModalComponent, never>;
|
|
30
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UserRequiredFieldsModalComponent, "sneat-user-required-fields-form", never, { "space": { "alias": "space"; "required": true; }; }, {}, never, never, true, never>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UserRequiredFieldsModalComponent, "sneat-user-required-fields-form", never, { "space": { "alias": "space"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
31
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { Auth } from '@angular/fire/auth';
|
|
3
|
-
import { IonInput } from '@ionic/angular
|
|
3
|
+
import { IonInput } from '@ionic/angular';
|
|
4
4
|
import { IAppInfo } from '@sneat/core';
|
|
5
5
|
import { UserCredential } from 'firebase/auth';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
@@ -26,7 +26,7 @@ export declare class EmailLoginFormComponent {
|
|
|
26
26
|
readonly loggedIn: EventEmitter<UserCredential>;
|
|
27
27
|
protected readonly emailInput: import("@angular/core").Signal<IonInput | undefined>;
|
|
28
28
|
protected readonly spaceTitleInput: import("@angular/core").Signal<IonInput | undefined>;
|
|
29
|
-
readonly setFocusToInput: (input?: IonInput | import("@ionic/angular
|
|
29
|
+
readonly setFocusToInput: (input?: IonInput | import("@ionic/angular").IonTextarea, delay?: number) => void;
|
|
30
30
|
constructor();
|
|
31
31
|
get validEmail(): boolean;
|
|
32
32
|
getFirebaseAuth(): Auth;
|
|
@@ -7,12 +7,12 @@ export declare class LoginWithTelegramComponent implements OnInit {
|
|
|
7
7
|
readonly authWithTelegram: SneatAuthWithTelegramService;
|
|
8
8
|
private readonly telegramLoginConfig;
|
|
9
9
|
constructor();
|
|
10
|
-
isUserAuthenticated: boolean
|
|
11
|
-
botID: string
|
|
12
|
-
size:
|
|
13
|
-
requestAccess:
|
|
14
|
-
userPic: boolean
|
|
10
|
+
readonly isUserAuthenticated: import("@angular/core").InputSignal<boolean>;
|
|
11
|
+
readonly botID: import("@angular/core").InputSignal<string>;
|
|
12
|
+
readonly size: import("@angular/core").InputSignal<"medium" | "small" | "large">;
|
|
13
|
+
readonly requestAccess: import("@angular/core").InputSignal<"write" | "read">;
|
|
14
|
+
readonly userPic: import("@angular/core").InputSignal<boolean>;
|
|
15
15
|
ngOnInit(): void;
|
|
16
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<LoginWithTelegramComponent, never>;
|
|
17
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LoginWithTelegramComponent, "sneat-login-with-telegram", never, { "isUserAuthenticated": { "alias": "isUserAuthenticated"; "required": false; }; "botID": { "alias": "botID"; "required": false; }; "size": { "alias": "size"; "required": false; }; "requestAccess": { "alias": "requestAccess"; "required": false; }; "userPic": { "alias": "userPic"; "required": false; }; }, {}, never, never, true, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LoginWithTelegramComponent, "sneat-login-with-telegram", never, { "isUserAuthenticated": { "alias": "isUserAuthenticated"; "required": false; "isSignal": true; }; "botID": { "alias": "botID"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "requestAccess": { "alias": "requestAccess"; "required": false; "isSignal": true; }; "userPic": { "alias": "userPic"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
18
18
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sneat/auth-ui",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@angular/common": ">=
|
|
9
|
-
"@angular/core": ">=
|
|
10
|
-
"@ionic/angular": ">=
|
|
8
|
+
"@angular/common": ">=22.0.0 <23.0.0",
|
|
9
|
+
"@angular/core": ">=22.0.0 <23.0.0",
|
|
10
|
+
"@ionic/angular": ">=9.0.0 <10.0.0",
|
|
11
11
|
"firebase": "*",
|
|
12
12
|
"@angular/fire": ">=20",
|
|
13
13
|
"@sneat/random": "*"
|