pwa-auth 2.0.4 → 2.0.5
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/CHANGELOG.md +13 -1
- package/README.md +54 -34
- package/demo/index.html +22 -126
- package/demo/pwa-styles.css +77 -0
- package/deploy/css/font.d.ts.map +1 -1
- package/deploy/css/form/button.d.ts.map +1 -1
- package/deploy/css/form/input.d.ts.map +1 -1
- package/deploy/css/form/label.d.ts.map +1 -1
- package/deploy/css/form/list.d.ts.map +1 -1
- package/deploy/css/svg.d.ts.map +1 -1
- package/deploy/css/toggle.d.ts.map +1 -1
- package/deploy/custom-elements/drawer/css/drawer.d.ts.map +1 -1
- package/deploy/custom-elements/drawer/css/exit.d.ts.map +1 -1
- package/deploy/custom-elements/drawer/css/link.d.ts.map +1 -1
- package/deploy/custom-elements/drawer/css/paragraph.d.ts.map +1 -1
- package/deploy/custom-elements/drawer/css/toggle.d.ts.map +1 -1
- package/deploy/custom-elements/drawer/drawer.d.ts.map +1 -1
- package/deploy/custom-elements/drawer/drawer.js +1 -1
- package/deploy/custom-elements/drawer/input/forgot.d.ts.map +1 -1
- package/deploy/custom-elements/drawer/input/forgot.js +1 -1
- package/deploy/custom-elements/drawer/input/login.d.ts.map +1 -1
- package/deploy/custom-elements/drawer/input/login.js +1 -1
- package/deploy/custom-elements/drawer/input/sign-up.d.ts.map +1 -1
- package/deploy/custom-elements/drawer/input/sign-up.js +1 -1
- package/deploy/custom-elements/icon/css/icon.d.ts.map +1 -1
- package/deploy/custom-elements/icon/css/icon.js +0 -1
- package/deploy/custom-elements/icon/icon.d.ts.map +1 -1
- package/deploy/custom-elements/settings/css/navigation.d.ts.map +1 -1
- package/deploy/custom-elements/settings/input/delete.d.ts.map +1 -1
- package/deploy/custom-elements/settings/input/delete.js +1 -1
- package/deploy/custom-elements/settings/input/email.d.ts.map +1 -1
- package/deploy/custom-elements/settings/input/email.js +1 -1
- package/deploy/custom-elements/settings/input/images.d.ts.map +1 -1
- package/deploy/custom-elements/settings/input/images.js +1 -1
- package/deploy/custom-elements/settings/input/name.d.ts.map +1 -1
- package/deploy/custom-elements/settings/input/name.js +1 -1
- package/deploy/custom-elements/settings/input/password.d.ts.map +1 -1
- package/deploy/custom-elements/settings/input/password.js +1 -1
- package/deploy/custom-elements/settings/input/uploader.d.ts +0 -2
- package/deploy/custom-elements/settings/input/uploader.d.ts.map +1 -1
- package/deploy/custom-elements/settings/input/uploader.js +11 -22
- package/deploy/custom-elements/settings/settings.d.ts.map +1 -1
- package/deploy/firebase/firebase-login.d.ts +21 -0
- package/deploy/firebase/firebase-login.d.ts.map +1 -0
- package/deploy/firebase/firebase-login.js +85 -0
- package/deploy/firebase/firebase.d.ts +20 -0
- package/deploy/firebase/firebase.d.ts.map +1 -0
- package/deploy/firebase/firebase.js +76 -0
- package/deploy/firebase/start.d.ts.map +1 -0
- package/deploy/{start.js → firebase/start.js} +5 -4
- package/deploy/lazy-loader.d.ts.map +1 -1
- package/deploy/redux/backend.d.ts.map +1 -1
- package/deploy/redux/drawer.d.ts.map +1 -1
- package/deploy/redux/frontend.d.ts.map +1 -1
- package/deploy/redux/object.d.ts.map +1 -1
- package/deploy/store.d.ts.map +1 -1
- package/npm/pwa-auth.js +1 -1
- package/package.json +4 -3
- package/source/css/font.ts +17 -0
- package/source/css/form/button.ts +55 -0
- package/source/css/form/input.ts +25 -0
- package/source/css/form/label.ts +25 -0
- package/source/css/form/list.ts +23 -0
- package/source/css/svg.ts +5 -0
- package/source/css/toggle.ts +9 -0
- package/source/custom-elements/drawer/css/drawer.ts +64 -0
- package/source/custom-elements/drawer/css/exit.ts +49 -0
- package/source/custom-elements/drawer/css/link.ts +15 -0
- package/source/custom-elements/drawer/css/paragraph.ts +11 -0
- package/source/custom-elements/drawer/css/toggle.ts +19 -0
- package/source/custom-elements/drawer/drawer.ts +120 -0
- package/source/custom-elements/drawer/input/forgot.ts +121 -0
- package/source/custom-elements/drawer/input/login.ts +135 -0
- package/source/custom-elements/drawer/input/sign-up.ts +158 -0
- package/source/custom-elements/icon/css/icon.ts +70 -0
- package/source/custom-elements/icon/icon.ts +87 -0
- package/source/custom-elements/settings/css/navigation.ts +92 -0
- package/source/custom-elements/settings/input/delete.ts +83 -0
- package/source/custom-elements/settings/input/email.ts +135 -0
- package/source/custom-elements/settings/input/images.ts +57 -0
- package/source/custom-elements/settings/input/name.ts +99 -0
- package/source/custom-elements/settings/input/password.ts +156 -0
- package/source/custom-elements/settings/input/uploader.ts +326 -0
- package/source/custom-elements/settings/settings.ts +202 -0
- package/source/firebase/firebase-login.ts +246 -0
- package/source/firebase/firebase.ts +214 -0
- package/source/firebase/start.ts +216 -0
- package/source/lazy-loader.ts +20 -0
- package/source/redux/backend.ts +94 -0
- package/source/redux/drawer.ts +37 -0
- package/source/redux/frontend.ts +134 -0
- package/source/redux/object.ts +31 -0
- package/source/store.ts +19 -0
- package/website/404.html +33 -0
- package/website/THIRD_PARTY_LICENSES.txt +303 -0
- package/website/css/pwa-styles.css +36 -0
- package/website/css/styles.css +67 -0
- package/website/images/empty.jpg +0 -0
- package/website/images/favicon.ico +0 -0
- package/website/images/manifest/logo-144.png +0 -0
- package/website/images/manifest/logo-192.png +0 -0
- package/website/images/manifest/logo-48.png +0 -0
- package/website/images/manifest/logo-512.png +0 -0
- package/website/images/manifest/logo-72.png +0 -0
- package/website/images/manifest/logo-96.png +0 -0
- package/website/images/manifest/maskable_icon_x128.png +0 -0
- package/website/images/manifest/maskable_icon_x192.png +0 -0
- package/website/images/manifest/maskable_icon_x384.png +0 -0
- package/website/images/manifest/maskable_icon_x48.png +0 -0
- package/website/images/manifest/maskable_icon_x512.png +0 -0
- package/website/images/manifest/maskable_icon_x72.png +0 -0
- package/website/images/manifest/maskable_icon_x96.png +0 -0
- package/website/index.html +64 -0
- package/website/js/pwa-auth.js +306 -0
- package/website/sitemap.xml +11 -0
- package/deploy/interface.d.ts +0 -37
- package/deploy/interface.d.ts.map +0 -1
- package/deploy/interface.js +0 -176
- package/deploy/start.d.ts.map +0 -1
- /package/deploy/{start.d.ts → firebase/start.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../../../../
|
|
1
|
+
{"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../../../../source/custom-elements/settings/input/name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5D,OAAO,EAAS,QAAQ,EAAE,MAAS,gBAAgB,CAAC;;;;;;;;;;;;;;AAQpD,qBAAa,SAAU,SAAQ,cAA0B;IAGN,KAAK,SAAM;IAEnD,OAAO,CAAC,KAAK,CAAmB;;IAIzC,YAAY,CAAC,KAAK,EAAE,QAAQ;IAK5B,MAAM,KAAK,MAAM,IAAI,cAAc,CAQ3B;IAER,MAAM;IA6BN,OAAO,CAAC,OAAO,CAEd;IAGD,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,YAAY,CAWnB;CAKF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
|
@@ -10,7 +10,7 @@ import { connect } from "pwa-helpers";
|
|
|
10
10
|
import { store } from "../../../store";
|
|
11
11
|
import { updateProfile } from "firebase/auth";
|
|
12
12
|
import { accName } from "../../../redux/backend";
|
|
13
|
-
import { auth } from "../../../start";
|
|
13
|
+
import { auth } from "../../../firebase/start";
|
|
14
14
|
import { labelStyle } from "../../../css/form/label";
|
|
15
15
|
import { inputStyle } from "../../../css/form/input";
|
|
16
16
|
import { buttonStyle } from "../../../css/form/button";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../../
|
|
1
|
+
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../../source/custom-elements/settings/input/password.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5D,OAAc,EAAE,QAAQ,EAAE,MAAO,gBAAgB,CAAC;;;;;;;;;;;;;;AAOlD,qBAAa,aAAc,SAAQ,kBAA0B;IAElD,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,QAAQ,CAAoB;IACpC,OAAO,CAAC,KAAK,CAA0B;;IAIhD,SAAS,CAAC,YAAY;IAQrB,YAAY,CAAC,KAAK,EAAE,QAAQ;IAK7B,OAAO,CAAC,iBAAiB;IAKzB,MAAM,KAAK,MAAM,IAAI,cAAc,CAc3B;IAER,MAAM;IAkDN,OAAO,CAAC,OAAO,CAEd;IAGD,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,UAAU,CAWjB;CAEF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}
|
|
@@ -8,7 +8,7 @@ import { LitElement, css, html } from "lit";
|
|
|
8
8
|
import { state } from "lit/decorators.js";
|
|
9
9
|
import { connect } from "pwa-helpers";
|
|
10
10
|
import store from "../../../store";
|
|
11
|
-
import { auth } from "../../../start";
|
|
11
|
+
import { auth } from "../../../firebase/start";
|
|
12
12
|
import { labelStyle } from "../../../css/form/label";
|
|
13
13
|
import { inputStyle } from "../../../css/form/input";
|
|
14
14
|
import { buttonStyle } from "../../../css/form/button";
|
|
@@ -18,14 +18,12 @@ export declare class ContactPhoto extends ContactPhoto_base {
|
|
|
18
18
|
private user;
|
|
19
19
|
private login;
|
|
20
20
|
private progress;
|
|
21
|
-
private downloadURL;
|
|
22
21
|
private error;
|
|
23
22
|
private status;
|
|
24
23
|
constructor();
|
|
25
24
|
stateChanged(state: AppState): void;
|
|
26
25
|
static get styles(): CSSResultArray;
|
|
27
26
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
28
|
-
private appendToFileLocation;
|
|
29
27
|
private saveImage;
|
|
30
28
|
private dispatchPhoto;
|
|
31
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../../../
|
|
1
|
+
{"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../../../source/custom-elements/settings/input/uploader.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,cAAc,EAAE,MAAQ,KAAK,CAAC;AAE9D,OAAO,EAAS,QAAQ,EAAE,MAAe,gBAAgB,CAAC;;;;;;;;;;;;;;AAQ1D,qBAAa,YAAa,SAAQ,iBAA0B;IAGvC,KAAK,EAAG,MAAM,GAAG,IAAI,GAAG,GAAG,CAAM;IAE3C,OAAO,CAAC,IAAI,CAAsB;IAClC,OAAO,CAAC,KAAK,CAAmB;IAIhC,OAAO,CAAC,QAAQ,CAAa;IAE7B,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,MAAM,CAAc;;IAWrC,YAAY,CAAC,KAAK,EAAE,QAAQ;IAU5B,MAAM,KAAK,MAAM,IAAG,cAAc,CAwBjC;IAED,SAAS,CAAC,MAAM;YA6FF,SAAS;IA0IvB,OAAO,CAAC,aAAa,CAYpB;CAEF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,eAAe,EAAE,YAAY,CAAC;KACjC;CACF"}
|
|
@@ -8,7 +8,7 @@ import { html, css, LitElement } from 'lit';
|
|
|
8
8
|
import { property, state } from 'lit/decorators.js';
|
|
9
9
|
import { store } from '../../../store';
|
|
10
10
|
import { connect } from 'pwa-helpers';
|
|
11
|
-
import { auth, storage } from '../../../start';
|
|
11
|
+
import { auth, storage, user } from '../../../firebase/start';
|
|
12
12
|
import { updateProfile } from 'firebase/auth';
|
|
13
13
|
import { accImage } from '../../../redux/backend';
|
|
14
14
|
import { ref, updateMetadata, getDownloadURL, uploadBytesResumable } from "@firebase/storage";
|
|
@@ -20,7 +20,6 @@ export class ContactPhoto extends connect(store)(LitElement) {
|
|
|
20
20
|
this.user = '';
|
|
21
21
|
this.login = false;
|
|
22
22
|
this.progress = 0;
|
|
23
|
-
this.downloadURL = '';
|
|
24
23
|
this.error = '';
|
|
25
24
|
this.status = '';
|
|
26
25
|
this.dispatchPhoto = async (url) => {
|
|
@@ -30,7 +29,6 @@ export class ContactPhoto extends connect(store)(LitElement) {
|
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
31
|
this.progress = 0;
|
|
33
|
-
this.downloadURL = '';
|
|
34
32
|
this.error = '';
|
|
35
33
|
this.status = '';
|
|
36
34
|
}
|
|
@@ -129,17 +127,9 @@ export class ContactPhoto extends connect(store)(LitElement) {
|
|
|
129
127
|
|
|
130
128
|
</label>
|
|
131
129
|
|
|
132
|
-
<p style="text-align:center;">${this.status}</p>
|
|
130
|
+
<p style="text-align:center;">${this.status}${this.error}</p>
|
|
133
131
|
`;
|
|
134
132
|
}
|
|
135
|
-
appendToFileLocation(filePath, appendString) {
|
|
136
|
-
const lastDotIndex = filePath.lastIndexOf('.');
|
|
137
|
-
if (lastDotIndex <= 0)
|
|
138
|
-
return filePath;
|
|
139
|
-
const basePath = filePath.substring(0, lastDotIndex);
|
|
140
|
-
const extension = filePath.substring(lastDotIndex);
|
|
141
|
-
return `${basePath}${appendString}${extension}`;
|
|
142
|
-
}
|
|
143
133
|
async saveImage() {
|
|
144
134
|
const uploader = this.shadowRoot.querySelector('.uploader');
|
|
145
135
|
if (auth.currentUser) {
|
|
@@ -195,13 +185,15 @@ export class ContactPhoto extends connect(store)(LitElement) {
|
|
|
195
185
|
.then((url) => {
|
|
196
186
|
updateMetadata(location, newMetadata)
|
|
197
187
|
.then(() => { }).catch((error) => { console.log("error: ", error); });
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
188
|
+
if (user) {
|
|
189
|
+
updateProfile(user, { photoURL: url })
|
|
190
|
+
.then(() => {
|
|
191
|
+
uploader.value = 100;
|
|
192
|
+
uploader.textContent = 'Complete';
|
|
193
|
+
});
|
|
194
|
+
this.status = 'User profile updated successfully!';
|
|
195
|
+
this.dispatchPhoto(url);
|
|
196
|
+
}
|
|
205
197
|
}).catch(() => { });
|
|
206
198
|
});
|
|
207
199
|
}
|
|
@@ -219,9 +211,6 @@ __decorate([
|
|
|
219
211
|
__decorate([
|
|
220
212
|
state()
|
|
221
213
|
], ContactPhoto.prototype, "progress", void 0);
|
|
222
|
-
__decorate([
|
|
223
|
-
state()
|
|
224
|
-
], ContactPhoto.prototype, "downloadURL", void 0);
|
|
225
214
|
__decorate([
|
|
226
215
|
state()
|
|
227
216
|
], ContactPhoto.prototype, "error", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../source/custom-elements/settings/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAe,KAAK,CAAC;AAGrD,OAAO,EAAS,QAAQ,EAAE,MAAqB,aAAa,CAAC;AAG7D,OAAO,kBAAkB,CAAC;AAC1B,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;;;;;;;;;;;;;;AAGxB,qBACa,YAAa,SAAQ,iBAA0B;IAEjD,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,IAAI,CAAM;;IAI3B,SAAS,CAAC,YAAY;IA8BtB,YAAY,CAAC,KAAK,EAAE,QAAQ;IAK5B,MAAM,KAAK,MAAM,8BAyCX;IAEN,SAAS,CAAC,MAAM;CA6FjB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,eAAe,EAAE,YAAY,CAAC;KACjC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface baseVerify {
|
|
2
|
+
verifyPasswordResetCode: any;
|
|
3
|
+
emailVerification: any;
|
|
4
|
+
}
|
|
5
|
+
interface baseLogin {
|
|
6
|
+
signOut: any;
|
|
7
|
+
isSignInWithEmailLink: any;
|
|
8
|
+
signInWithEmailAndPassword: any;
|
|
9
|
+
signInWithPopup: any;
|
|
10
|
+
signInWithRedirect: any;
|
|
11
|
+
signInAnonymously: any;
|
|
12
|
+
signInWithCustomToken: any;
|
|
13
|
+
signInWithEmailLink: any;
|
|
14
|
+
signInWithPhoneNumber: any;
|
|
15
|
+
signInWithCredential: any;
|
|
16
|
+
updateCurrentUser: any;
|
|
17
|
+
}
|
|
18
|
+
export declare const authVerify: baseVerify;
|
|
19
|
+
export declare const authLogin: baseLogin;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=firebase-login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firebase-login.d.ts","sourceRoot":"","sources":["../../source/firebase/firebase-login.ts"],"names":[],"mappings":"AAkBA,UAAU,UAAU;IAClB,uBAAuB,EAAG,GAAG,CAAC;IAC9B,iBAAiB,EAAE,GAAG,CAAA;CACvB;AAED,UAAU,SAAS;IACjB,OAAO,EAAG,GAAG,CAAC;IACd,qBAAqB,EAAG,GAAG,CAAC;IAC5B,0BAA0B,EAAG,GAAG,CAAC;IACjC,eAAe,EAAG,GAAG,CAAC;IACtB,kBAAkB,EAAG,GAAG,CAAC;IACzB,iBAAiB,EAAG,GAAG,CAAC;IACxB,qBAAqB,EAAG,GAAG,CAAC;IAC5B,mBAAmB,EAAG,GAAG,CAAC;IAC1B,qBAAqB,EAAG,GAAG,CAAC;IAC5B,oBAAoB,EAAG,GAAG,CAAC;IAC3B,iBAAiB,EAAG,GAAG,CAAA;CACxB;AAED,eAAO,MAAM,UAAU,EAAG,UAiBzB,CAAA;AACD,eAAO,MAAM,SAAS,EAAG,SAwExB,CAAA"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { isSignInWithEmailLink, signInAnonymously, signInWithCredential, signInWithCustomToken, signInWithEmailAndPassword, signInWithEmailLink, signInWithPhoneNumber, signInWithPopup, signInWithRedirect, signOut, updateCurrentUser, verifyPasswordResetCode, sendEmailVerification } from "firebase/auth";
|
|
2
|
+
import { auth, user } from "./start";
|
|
3
|
+
export const authVerify = {
|
|
4
|
+
verifyPasswordResetCode: {
|
|
5
|
+
description: "Verifies a password reset code sent to the user.",
|
|
6
|
+
action: (code) => verifyPasswordResetCode(auth, code)
|
|
7
|
+
.then(email => ({ email }))
|
|
8
|
+
.catch(error => ({ error: error.code, message: error.message }))
|
|
9
|
+
},
|
|
10
|
+
emailVerification: {
|
|
11
|
+
description: "Sends an email verification to the current user.",
|
|
12
|
+
action: () => {
|
|
13
|
+
if (user) {
|
|
14
|
+
sendEmailVerification(user)
|
|
15
|
+
.then(() => ({ success: true }))
|
|
16
|
+
.catch((error) => ({ error: error.code, message: error.message }));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export const authLogin = {
|
|
22
|
+
isSignInWithEmailLink: {
|
|
23
|
+
description: "Checks if a link is a valid sign-in with email link.",
|
|
24
|
+
action: (link) => isSignInWithEmailLink(auth, link)
|
|
25
|
+
},
|
|
26
|
+
signInWithEmailAndPassword: {
|
|
27
|
+
description: "Signs in a user with email and password.",
|
|
28
|
+
action: (email, password) => signInWithEmailAndPassword(auth, email, password)
|
|
29
|
+
.then(userCredential => ({ user: userCredential.user }))
|
|
30
|
+
.catch(error => ({ error: error.code, message: error.message }))
|
|
31
|
+
},
|
|
32
|
+
signInWithPopup: {
|
|
33
|
+
description: "Signs in a user via a popup with a federated provider (e.g., Google, Facebook).",
|
|
34
|
+
action: (provider) => signInWithPopup(auth, provider)
|
|
35
|
+
.then(result => ({ user: result.user }))
|
|
36
|
+
.catch(error => ({ error: error.code, message: error.message }))
|
|
37
|
+
},
|
|
38
|
+
signInWithRedirect: {
|
|
39
|
+
description: "Signs in a user via redirect with a federated provider.",
|
|
40
|
+
action: (provider) => signInWithRedirect(auth, provider)
|
|
41
|
+
.catch(error => ({ error: error.code, message: error.message }))
|
|
42
|
+
},
|
|
43
|
+
signInAnonymously: {
|
|
44
|
+
description: "Signs in a user anonymously without credentials.",
|
|
45
|
+
action: () => signInAnonymously(auth)
|
|
46
|
+
.then(userCredential => ({ user: userCredential.user }))
|
|
47
|
+
.catch(error => ({ error: error.code, message: error.message }))
|
|
48
|
+
},
|
|
49
|
+
signInWithCustomToken: {
|
|
50
|
+
description: "Signs in a user with a custom token from an external auth system.",
|
|
51
|
+
action: (token) => signInWithCustomToken(auth, token)
|
|
52
|
+
.then(userCredential => ({ user: userCredential.user }))
|
|
53
|
+
.catch(error => ({ error: error.code, message: error.message }))
|
|
54
|
+
},
|
|
55
|
+
signInWithEmailLink: {
|
|
56
|
+
description: "Signs in a user with an email link.",
|
|
57
|
+
action: (email, link) => signInWithEmailLink(auth, email, link)
|
|
58
|
+
.then(userCredential => ({ user: userCredential.user }))
|
|
59
|
+
.catch(error => ({ error: error.code, message: error.message }))
|
|
60
|
+
},
|
|
61
|
+
signInWithPhoneNumber: {
|
|
62
|
+
description: "Signs in a user with a phone number and verification code.",
|
|
63
|
+
action: (phoneNumber, appVerifier) => signInWithPhoneNumber(auth, phoneNumber, appVerifier)
|
|
64
|
+
.then(confirmationResult => ({ confirmationResult }))
|
|
65
|
+
.catch(error => ({ error: error.code, message: error.message }))
|
|
66
|
+
},
|
|
67
|
+
signInWithCredential: {
|
|
68
|
+
description: "Signs in a user with a credential object (e.g., from OAuth).",
|
|
69
|
+
action: (credential) => signInWithCredential(auth, credential)
|
|
70
|
+
.then(userCredential => ({ user: userCredential.user }))
|
|
71
|
+
.catch(error => ({ error: error.code, message: error.message }))
|
|
72
|
+
},
|
|
73
|
+
updateCurrentUser: {
|
|
74
|
+
description: "Updates the current user with a new User object.",
|
|
75
|
+
action: () => updateCurrentUser(auth, user)
|
|
76
|
+
.then(() => ({ success: true }))
|
|
77
|
+
.catch(error => ({ error: error.code, message: error.message }))
|
|
78
|
+
},
|
|
79
|
+
signOut: {
|
|
80
|
+
description: "Signs out the current user.",
|
|
81
|
+
action: () => signOut(auth)
|
|
82
|
+
.then(() => ({ success: true }))
|
|
83
|
+
.catch(error => ({ error: error.code, message: error.message }))
|
|
84
|
+
}
|
|
85
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface base {
|
|
2
|
+
applyActionCode: any;
|
|
3
|
+
checkActionCode: any;
|
|
4
|
+
beforeAuthStateChanged: any;
|
|
5
|
+
confirmPasswordReset: any;
|
|
6
|
+
sendPasswordResetEmail: any;
|
|
7
|
+
connectAuthEmulator: any;
|
|
8
|
+
createUserWithEmailAndPassword: any;
|
|
9
|
+
fetchSignInMethodsForEmail: any;
|
|
10
|
+
getMultiFactorResolver: any;
|
|
11
|
+
getRedirectResult: any;
|
|
12
|
+
initializeRecaptchaConfig: any;
|
|
13
|
+
onAuthStateChanged: any;
|
|
14
|
+
onIdTokenChanged: any;
|
|
15
|
+
revokeAccessToken: any;
|
|
16
|
+
}
|
|
17
|
+
export declare const authFunctions: base;
|
|
18
|
+
export declare const recoverEmail: (actionCode: any) => void;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=firebase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firebase.d.ts","sourceRoot":"","sources":["../../source/firebase/firebase.ts"],"names":[],"mappings":"AAiBA,UAAU,IAAI;IACZ,eAAe,EAAG,GAAG,CAAC;IACtB,eAAe,EAAG,GAAG,CAAC;IACtB,sBAAsB,EAAG,GAAG,CAAC;IAC7B,oBAAoB,EAAG,GAAG,CAAC;IAC3B,sBAAsB,EAAG,GAAG,CAAC;IAC7B,mBAAmB,EAAG,GAAG,CAAC;IAC1B,8BAA8B,EAAG,GAAG,CAAC;IACrC,0BAA0B,EAAG,GAAG,CAAC;IACjC,sBAAsB,EAAG,GAAG,CAAC;IAC7B,iBAAiB,EAAG,GAAG,CAAC;IACxB,yBAAyB,EAAG,GAAG,CAAC;IAChC,kBAAkB,EAAG,GAAG,CAAC;IACzB,gBAAgB,EAAG,GAAG,CAAC;IACvB,iBAAiB,EAAG,GAAG,CAAA;CACxB;AAGD,eAAO,MAAM,aAAa,EAAG,IAqF5B,CAAC;AAKF,eAAO,MAAM,YAAY,GAAc,YAAW,GAAG,SA6BpD,CAAA"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { applyActionCode, beforeAuthStateChanged, checkActionCode, confirmPasswordReset, createUserWithEmailAndPassword, fetchSignInMethodsForEmail, getRedirectResult, onAuthStateChanged, onIdTokenChanged, sendPasswordResetEmail } from "firebase/auth";
|
|
2
|
+
import { auth } from "./start";
|
|
3
|
+
export const authFunctions = {
|
|
4
|
+
applyActionCode: {
|
|
5
|
+
description: "Applies an out-of-band verification code (e.g., email verification).",
|
|
6
|
+
action: (oobCode) => applyActionCode(auth, oobCode)
|
|
7
|
+
.then(() => ({ success: true }))
|
|
8
|
+
.catch((error) => ({ error: error.code, message: error.message }))
|
|
9
|
+
},
|
|
10
|
+
checkActionCode: {
|
|
11
|
+
description: "Checks the metadata of an out-of-band verification code.",
|
|
12
|
+
action: (code) => checkActionCode(auth, code)
|
|
13
|
+
.then((info) => ({ info }))
|
|
14
|
+
.catch((error) => ({ error: error.code, message: error.message }))
|
|
15
|
+
},
|
|
16
|
+
beforeAuthStateChanged: {
|
|
17
|
+
description: 'Adds a blocking callback that runs before an auth state change sets a new user.',
|
|
18
|
+
code: (callback, onAbort) => beforeAuthStateChanged(auth, callback, onAbort)
|
|
19
|
+
},
|
|
20
|
+
confirmPasswordReset: {
|
|
21
|
+
description: "Completes the password reset process with a code and new password.",
|
|
22
|
+
action: (code, newPassword) => confirmPasswordReset(auth, code, newPassword)
|
|
23
|
+
.then(() => ({ success: true }))
|
|
24
|
+
.catch((error) => ({ error: error.code, message: error.message }))
|
|
25
|
+
},
|
|
26
|
+
sendPasswordResetEmail: {
|
|
27
|
+
description: "Sends a password reset email to the user.",
|
|
28
|
+
action: (email) => sendPasswordResetEmail(auth, email)
|
|
29
|
+
.then(() => ({ success: true }))
|
|
30
|
+
.catch(error => ({ error: error.code, message: error.message }))
|
|
31
|
+
},
|
|
32
|
+
connectAuthEmulator: {},
|
|
33
|
+
createUserWithEmailAndPassword: {
|
|
34
|
+
description: "Creates a new user account with email and password, and signs them in.",
|
|
35
|
+
action: (email, password) => createUserWithEmailAndPassword(auth, email, password)
|
|
36
|
+
.then((userCredential) => ({ user: userCredential.user }))
|
|
37
|
+
.catch((error) => ({ error: error.code, message: error.message }))
|
|
38
|
+
},
|
|
39
|
+
fetchSignInMethodsForEmail: {
|
|
40
|
+
description: "Gets the list of sign-in methods for a given email.",
|
|
41
|
+
action: (email) => fetchSignInMethodsForEmail(auth, email)
|
|
42
|
+
.then((methods) => ({ methods }))
|
|
43
|
+
.catch((error) => ({ error: error.code, message: error.message }))
|
|
44
|
+
},
|
|
45
|
+
getMultiFactorResolver: {},
|
|
46
|
+
getRedirectResult: {
|
|
47
|
+
description: "Retrieves the result of a redirect-based sign-in flow.",
|
|
48
|
+
action: () => getRedirectResult(auth)
|
|
49
|
+
.then((result) => ({ user: result.user }))
|
|
50
|
+
.catch((error) => ({ error: error.code, message: error.message }))
|
|
51
|
+
},
|
|
52
|
+
initializeRecaptchaConfig: {},
|
|
53
|
+
onAuthStateChanged: {
|
|
54
|
+
description: "Listens for changes in the authentication state.",
|
|
55
|
+
action: (callback) => onAuthStateChanged(auth, callback)
|
|
56
|
+
},
|
|
57
|
+
onIdTokenChanged: {
|
|
58
|
+
description: "Listens for changes in the ID token.",
|
|
59
|
+
action: (callback) => onIdTokenChanged(auth, callback)
|
|
60
|
+
},
|
|
61
|
+
revokeAccessToken: {}
|
|
62
|
+
};
|
|
63
|
+
export const recoverEmail = (actionCode) => {
|
|
64
|
+
let restoredEmail = null;
|
|
65
|
+
checkActionCode(auth, actionCode).then((info) => {
|
|
66
|
+
restoredEmail = info['data']['email'];
|
|
67
|
+
return applyActionCode(auth, actionCode);
|
|
68
|
+
}).then(() => {
|
|
69
|
+
sendPasswordResetEmail(auth, restoredEmail).then(() => {
|
|
70
|
+
}).catch((error) => {
|
|
71
|
+
console.log(error);
|
|
72
|
+
});
|
|
73
|
+
}).catch((error) => {
|
|
74
|
+
console.log(error);
|
|
75
|
+
});
|
|
76
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../source/firebase/start.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAiB,MAAM,cAAc,CAAC;AAG1D,OAAO,EAAE,IAAI,EAAE,IAAI,EAA+D,MAAM,eAAe,CAAC;AAGxG,OAAO,EAAgB,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAG7E,OAAO,EAAc,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAiBhE,eAAO,MAAM,WAAW,EAAM,WAAiD,CAAC;AAChF,eAAO,MAAM,EAAE,EAAe,SAA6C,CAAC;AAC5E,eAAO,MAAM,OAAO,EAAU,eAA2C,CAAC;AAC1E,eAAO,MAAM,IAAI,EAAa,IAAwC,CAAC;AACvE,eAAO,MAAM,IAAI,EAAa,IAAI,GAAG,IAA6B,CAAC;AA+HnE,eAAO,MAAM,MAAM,qBAAoD,CAAC;AACxE,eAAO,MAAM,UAAU,qBAAiE,CAAC;AACzF,eAAO,MAAM,gBAAgB,qBAA2D,CAAC;AACzF,eAAO,MAAM,cAAc,GAAc,SAAQ,MAAM,EAAE,MAAK,MAAM,kBAInE,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { store } from '
|
|
2
|
-
import { closeSign, iconAuth, nameAuth, userAuth } from '
|
|
3
|
-
import { accID, accEmail, accImage, accName } from '
|
|
1
|
+
import { store } from '../store';
|
|
2
|
+
import { closeSign, iconAuth, nameAuth, userAuth } from '../redux/frontend';
|
|
3
|
+
import { accID, accEmail, accImage, accName } from '../redux/backend';
|
|
4
4
|
import { initializeApp } from 'firebase/app';
|
|
5
5
|
import { getAuth, onAuthStateChanged, sendEmailVerification, signOut } from 'firebase/auth';
|
|
6
6
|
import { getFirestore, doc, deleteDoc } from "firebase/firestore";
|
|
7
7
|
import { getStorage } from "@firebase/storage";
|
|
8
8
|
import { getAnalytics, logEvent } from "firebase/analytics";
|
|
9
9
|
import { isSupported } from "firebase/messaging";
|
|
10
|
-
|
|
10
|
+
const firebaseConfig = JSON.parse(process.env.FIREBASE_CONFIG || "{}");
|
|
11
|
+
export const application = initializeApp(firebaseConfig);
|
|
11
12
|
export const db = getFirestore(application);
|
|
12
13
|
export const storage = getStorage(application);
|
|
13
14
|
export const auth = getAuth(application);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-loader.d.ts","sourceRoot":"","sources":["../
|
|
1
|
+
{"version":3,"file":"lazy-loader.d.ts","sourceRoot":"","sources":["../source/lazy-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGjC,qBAAa,UAAW,SAAQ,UAAU;IAGN,MAAM,EAAG,OAAO,CAAS;IAE3D,YAAY;CAIb;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../source/redux/backend.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,aAAa,EAAE,MAAS,kBAAkB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiBvC,eAAO,MAAM,YAAY;6EAMU,aAAa,CAAC,OAAO,CAAC;yEAK1B,aAAa,CAAC,OAAO,CAAC;uEAKxB,aAAa,CAAC,MAAM,CAAC;yEAKnB,aAAa,CAAC,MAAM,CAAC;0EAKpB,aAAa,CAAC,MAAM,CAAC;0EAKrB,aAAa,CAAC,MAAM,CAAC;0EAKrB,aAAa,CAAC,MAAM,CAAC;2EAKpB,aAAa,CAAC,MAAM,CAAC;gFAKpD,CAAC;AAEH,eAAO,MAAQ,WAAW,uFAAE,KAAK,gFAAE,OAAO,kFAAE,QAAQ,mFAAE,QAAQ,mFAAE,QAAQ,mFAAE,OAAO,mFAAE,SAAS,kFAAyB,CAAC;;AAEtH,wBAAoC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../source/redux/drawer.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW;;;;;;;;;;;GA0BtB,CAAC;AAEH,eAAO,MAAQ,SAAS,+EAAE,WAAW,+EAAwB,CAAC;;;;AAE9D,wBAAmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../source/redux/frontend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,eAAO,MAAM,YAAY,EAAE,YA0B1B,CAAA;AAGD,eAAO,MAAM,SAAS;+EAKkB,aAAa,CAAC,MAAM,CAAC;2EAsBxB,aAAa,CAAC,OAAO,CAAC;;;;8EA0CvB,aAAa,CAAC,OAAO,CAAC;2EAKtB,aAAa,CAAC,MAAM,CAAC;2EAKpB,aAAa,CAAC,MAAM,CAAC;2EAKxD,CAAC;AAEH,eAAO,MAAQ,YAAY,oFAAE,QAAQ,gFAAE,QAAQ,gFAAE,QAAQ,iFAAE,UAAU,6EAAE,SAAS,4EAAE,YAAY,+EAAE,WAAW,kFAAsB,CAAC;;AAElI,wBAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../source/redux/object.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAa,OAAO,CAAC;IAC1B,MAAM,EAAY,OAAO,CAAC;IAC1B,QAAQ,EAAU,OAAO,CAAC;IAE1B,QAAQ,EAAU,MAAM,CAAC;IACzB,MAAM,EAAY,MAAM,CAAC;IACzB,QAAQ,EAAU,MAAM,CAAC;IAEzB,IAAI,EAAc,MAAM,CAAC;IACzB,QAAQ,EAAU,MAAM,CAAC;IACzB,KAAK,EAAa,MAAM,CAAC;IACzB,KAAK,EAAa,MAAM,CAAC;IAEzB,aAAa,EAAK,MAAM,CAAA;CACzB;AAGD,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAU,OAAO,CAAC;IAC1B,IAAI,EAAc,OAAO,CAAC;IAC1B,MAAM,EAAY,MAAM,CAAC;IAEzB,IAAI,EAAc,MAAM,CAAC;IACzB,KAAK,EAAa,MAAM,CAAC;IACzB,QAAQ,EAAU,MAAM,CAAC;IACzB,KAAK,EAAa,MAAM,CAAC;IAEzB,QAAQ,EAAU,MAAM,CAAA;CACzB"}
|
package/deploy/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../source/store.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;oCAOhB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC;AACzD,MAAM,MAAM,WAAW,GAAG,OAAO,KAAK,CAAC,QAAQ,CAAC;AAEhD,eAAe,KAAK,CAAC"}
|