pwa-auth 3.1.4 → 3.2.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/CHANGELOG.md +5 -0
- package/README.md +5 -3
- package/{transpiled/src-typescript → base}/css/form/button.d.ts +0 -1
- package/{transpiled/src-typescript → base}/css/form/button.js +1 -0
- package/base/css/form/button.js.map +1 -0
- package/{transpiled/src-typescript → base}/css/form/input.d.ts +0 -1
- package/{transpiled/src-typescript → base}/css/form/input.js +1 -0
- package/base/css/form/input.js.map +1 -0
- package/{transpiled/src-typescript → base}/css/form/label.d.ts +0 -1
- package/{transpiled/src-typescript → base}/css/form/label.js +1 -0
- package/base/css/form/label.js.map +1 -0
- package/{transpiled/src-typescript → base}/css/form/list.d.ts +0 -1
- package/{transpiled/src-typescript → base}/css/form/list.js +1 -0
- package/base/css/form/list.js.map +1 -0
- package/{transpiled/src-typescript → base}/css/svg.d.ts +0 -1
- package/{transpiled/src-typescript → base}/css/svg.js +1 -0
- package/base/css/svg.js.map +1 -0
- package/{transpiled/src-typescript → base}/css/toggle.d.ts +0 -1
- package/{transpiled/src-typescript → base}/css/toggle.js +1 -0
- package/base/css/toggle.js.map +1 -0
- package/{src/pwa-helpers.js → base/export/auth-helpers.d.ts} +1 -1
- package/base/export/auth-helpers.js +2 -0
- package/base/export/auth-helpers.js.map +1 -0
- package/base/export/pwa-auth.d.ts +4 -0
- package/base/export/pwa-auth.js +5 -0
- package/base/export/pwa-auth.js.map +1 -0
- package/{transpiled/src-typescript → base}/firebase/authentication.d.ts +1 -2
- package/{transpiled/src-typescript → base}/firebase/authentication.js +1 -0
- package/base/firebase/authentication.js.map +1 -0
- package/{transpiled/src-typescript → base}/firebase/interface.d.ts +0 -1
- package/{transpiled/src-typescript → base}/firebase/interface.js +1 -0
- package/base/firebase/interface.js.map +1 -0
- package/{transpiled/src-typescript → base}/redux/backend.d.ts +0 -1
- package/{transpiled/src-typescript → base}/redux/backend.js +1 -0
- package/base/redux/backend.js.map +1 -0
- package/{transpiled/src-typescript → base}/redux/drawer.d.ts +0 -1
- package/{transpiled/src-typescript → base}/redux/drawer.js +1 -0
- package/base/redux/drawer.js.map +1 -0
- package/{transpiled/src-typescript → base}/redux/frontend.d.ts +0 -1
- package/{transpiled/src-typescript → base}/redux/frontend.js +1 -0
- package/base/redux/frontend.js.map +1 -0
- package/{transpiled/src-typescript → base}/redux/object.d.ts +0 -1
- package/base/redux/object.js +2 -0
- package/base/redux/object.js.map +1 -0
- package/{transpiled/src-typescript → base}/store.d.ts +0 -1
- package/{transpiled/src-typescript → base}/store.js +1 -0
- package/base/store.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/drawer/css/drawer.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/drawer/css/drawer.js +1 -0
- package/base/webcomponents/drawer/css/drawer.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/drawer/css/exit.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/drawer/css/exit.js +1 -0
- package/base/webcomponents/drawer/css/exit.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/drawer/css/link.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/drawer/css/link.js +1 -0
- package/base/webcomponents/drawer/css/link.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/drawer/css/paragraph.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/drawer/css/paragraph.js +1 -0
- package/base/webcomponents/drawer/css/paragraph.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/drawer/css/toggle.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/drawer/css/toggle.js +1 -0
- package/base/webcomponents/drawer/css/toggle.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/drawer/drawer.d.ts +1 -2
- package/{transpiled/src-typescript → base}/webcomponents/drawer/drawer.js +4 -3
- package/base/webcomponents/drawer/drawer.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/drawer/input/login.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/drawer/input/login.js +1 -0
- package/base/webcomponents/drawer/input/login.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/drawer/input/sign-up.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/drawer/input/sign-up.js +1 -0
- package/base/webcomponents/drawer/input/sign-up.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/icon/css/icon.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/icon/css/icon.js +1 -0
- package/base/webcomponents/icon/css/icon.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/icon/icon.d.ts +1 -2
- package/{transpiled/src-typescript → base}/webcomponents/icon/icon.js +4 -3
- package/base/webcomponents/icon/icon.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/settings/css/navigation.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/settings/css/navigation.js +1 -0
- package/base/webcomponents/settings/css/navigation.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/settings/input/delete.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/settings/input/delete.js +1 -0
- package/base/webcomponents/settings/input/delete.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/settings/input/email.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/settings/input/email.js +1 -0
- package/base/webcomponents/settings/input/email.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/settings/input/name.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/settings/input/name.js +1 -0
- package/base/webcomponents/settings/input/name.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/settings/input/password.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/settings/input/password.js +1 -0
- package/base/webcomponents/settings/input/password.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/settings/input/uploader.d.ts +0 -1
- package/{transpiled/src-typescript → base}/webcomponents/settings/input/uploader.js +1 -0
- package/base/webcomponents/settings/input/uploader.js.map +1 -0
- package/{transpiled/src-typescript → base}/webcomponents/settings/settings.d.ts +1 -2
- package/{transpiled/src-typescript → base}/webcomponents/settings/settings.js +4 -3
- package/base/webcomponents/settings/settings.js.map +1 -0
- package/demonstration/index.html +52 -5
- package/{src-export/pwa-helpers.ts → export/auth-helpers.ts} +1 -1
- package/{src-export/tsconfig.production.json → export/export/tsconfigs.production.md} +3 -3
- package/export/pwa-auth.ts +4 -0
- package/package.json +21 -15
- package/demonstration/compiled/pwa-auth.js +0 -881
- package/demonstration/compiled/pwa-auth.js.map +0 -1
- package/demonstration/compiled/pwa-helpers-BN4uXXdl.js +0 -8
- package/demonstration/compiled/pwa-helpers-BN4uXXdl.js.map +0 -1
- package/demonstration/compiled/pwa-helpers.js +0 -8
- package/demonstration/compiled/pwa-helpers.js.map +0 -1
- package/demonstration/css/styles.css +0 -69
- package/images/empty.jpg +0 -0
- package/src/compiled/pwa-auth.js +0 -881
- package/src/compiled/pwa-auth.js.map +0 -1
- package/src/compiled/pwa-helpers-BN4uXXdl.js +0 -8
- package/src/compiled/pwa-helpers-BN4uXXdl.js.map +0 -1
- package/src/compiled/pwa-helpers.js +0 -8
- package/src/compiled/pwa-helpers.js.map +0 -1
- package/src/empty.jpg +0 -0
- package/src/pwa-auth.js +0 -3
- package/src-classes/pwa-auth.js +0 -3
- package/src-compiled/pwa-auth.js +0 -881
- package/src-compiled/pwa-auth.js.map +0 -1
- package/src-compiled/pwa-helpers-BN4uXXdl.js +0 -8
- package/src-compiled/pwa-helpers-BN4uXXdl.js.map +0 -1
- package/src-compiled/pwa-helpers.js +0 -8
- package/src-compiled/pwa-helpers.js.map +0 -1
- package/src-export/pwa-auth.ts +0 -3
- package/src-functions/pwa-helpers.js +0 -1
- package/src-typescript/css/default.ts +0 -111
- package/src-typescript/css/font.ts +0 -17
- package/src-typescript/css/form/button.ts +0 -55
- package/src-typescript/css/form/input.ts +0 -25
- package/src-typescript/css/form/label.ts +0 -23
- package/src-typescript/css/form/list.ts +0 -23
- package/src-typescript/css/svg.ts +0 -5
- package/src-typescript/css/toggle.ts +0 -9
- package/src-typescript/development/helpers-array.ts +0 -0
- package/src-typescript/development/junk/firebase-object.ts +0 -49
- package/src-typescript/development/junk/notes.md +0 -96
- package/src-typescript/development/junk/phone.ts +0 -146
- package/src-typescript/development/junk/photo.ts +0 -440
- package/src-typescript/development/junk/telephone.ts +0 -282
- package/src-typescript/development/login.ts +0 -246
- package/src-typescript/development/utilities-object.ts +0 -214
- package/src-typescript/firebase/authentication.ts +0 -11
- package/src-typescript/firebase/interface.ts +0 -187
- package/src-typescript/lazy-loader.ts +0 -20
- package/src-typescript/redux/backend.ts +0 -94
- package/src-typescript/redux/drawer.ts +0 -37
- package/src-typescript/redux/frontend.ts +0 -134
- package/src-typescript/redux/object.ts +0 -31
- package/src-typescript/store.ts +0 -19
- package/src-typescript/webcomponents/drawer/css/drawer.ts +0 -64
- package/src-typescript/webcomponents/drawer/css/exit.ts +0 -49
- package/src-typescript/webcomponents/drawer/css/link.ts +0 -15
- package/src-typescript/webcomponents/drawer/css/paragraph.ts +0 -11
- package/src-typescript/webcomponents/drawer/css/toggle.ts +0 -19
- package/src-typescript/webcomponents/drawer/drawer.ts +0 -120
- package/src-typescript/webcomponents/drawer/input/forgot.ts +0 -121
- package/src-typescript/webcomponents/drawer/input/login.ts +0 -135
- package/src-typescript/webcomponents/drawer/input/sign-up.ts +0 -159
- package/src-typescript/webcomponents/icon/css/icon.ts +0 -60
- package/src-typescript/webcomponents/icon/icon.ts +0 -71
- package/src-typescript/webcomponents/settings/css/navigation.ts +0 -92
- package/src-typescript/webcomponents/settings/input/delete.ts +0 -83
- package/src-typescript/webcomponents/settings/input/email.ts +0 -135
- package/src-typescript/webcomponents/settings/input/images.ts +0 -57
- package/src-typescript/webcomponents/settings/input/name.ts +0 -99
- package/src-typescript/webcomponents/settings/input/password.ts +0 -156
- package/src-typescript/webcomponents/settings/input/uploader.ts +0 -330
- package/src-typescript/webcomponents/settings/settings.ts +0 -205
- package/transpiled/src-export/pwa-auth.d.ts +0 -4
- package/transpiled/src-export/pwa-auth.d.ts.map +0 -1
- package/transpiled/src-export/pwa-auth.js +0 -3
- package/transpiled/src-export/pwa-helpers.d.ts +0 -2
- package/transpiled/src-export/pwa-helpers.d.ts.map +0 -1
- package/transpiled/src-export/pwa-helpers.js +0 -1
- package/transpiled/src-typescript/css/form/button.d.ts.map +0 -1
- package/transpiled/src-typescript/css/form/input.d.ts.map +0 -1
- package/transpiled/src-typescript/css/form/label.d.ts.map +0 -1
- package/transpiled/src-typescript/css/form/list.d.ts.map +0 -1
- package/transpiled/src-typescript/css/svg.d.ts.map +0 -1
- package/transpiled/src-typescript/css/toggle.d.ts.map +0 -1
- package/transpiled/src-typescript/firebase/authentication.d.ts.map +0 -1
- package/transpiled/src-typescript/firebase/interface.d.ts.map +0 -1
- package/transpiled/src-typescript/redux/backend.d.ts.map +0 -1
- package/transpiled/src-typescript/redux/drawer.d.ts.map +0 -1
- package/transpiled/src-typescript/redux/frontend.d.ts.map +0 -1
- package/transpiled/src-typescript/redux/object.d.ts.map +0 -1
- package/transpiled/src-typescript/redux/object.js +0 -1
- package/transpiled/src-typescript/store.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/drawer/css/drawer.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/drawer/css/exit.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/drawer/css/link.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/drawer/css/paragraph.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/drawer/css/toggle.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/drawer/drawer.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/drawer/input/login.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/drawer/input/sign-up.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/icon/css/icon.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/icon/icon.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/settings/css/navigation.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/settings/input/delete.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/settings/input/email.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/settings/input/name.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/settings/input/password.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/settings/input/uploader.d.ts.map +0 -1
- package/transpiled/src-typescript/webcomponents/settings/settings.d.ts.map +0 -1
- /package/demonstration/{css/pwa-styles.css → pwa-styles.css} +0 -0
- /package/{src → source}/THIRD_PARTY_LICENSES.txt +0 -0
- /package/{demonstration/images → source}/empty.jpg +0 -0
- /package/{src → source}/pwa-styles.css +0 -0
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { CSSResultArray, LitElement, css, html } from "lit";
|
|
2
|
-
import { state } from "lit/decorators.js";
|
|
3
|
-
import { connect } from "pwa-helpers";
|
|
4
|
-
import store, { AppState } from "../../../store";
|
|
5
|
-
import { buttonStyle } from "../../../css/form/button";
|
|
6
|
-
import { auth } from '../../../firebase/authentication';
|
|
7
|
-
|
|
8
|
-
export class DeleteUser extends connect(store)(LitElement) {
|
|
9
|
-
|
|
10
|
-
@state() private login : boolean = false;
|
|
11
|
-
@state() private email : string ='';
|
|
12
|
-
|
|
13
|
-
constructor() { super(); }
|
|
14
|
-
|
|
15
|
-
protected firstUpdated() {
|
|
16
|
-
|
|
17
|
-
this.shadowRoot!.querySelector('.deleteUser')!.addEventListener('click',() => {
|
|
18
|
-
this.alertDelete();
|
|
19
|
-
} );
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
stateChanged(state: AppState) {
|
|
24
|
-
this.login = state.frontend!.login;
|
|
25
|
-
this.email = state.backend!.email;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static get styles(): CSSResultArray { return [
|
|
29
|
-
buttonStyle,
|
|
30
|
-
css`
|
|
31
|
-
|
|
32
|
-
:host {
|
|
33
|
-
display: grid;
|
|
34
|
-
grid-template-rows: auto auto;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
p {
|
|
38
|
-
padding: 0 16px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
` ]; }
|
|
42
|
-
|
|
43
|
-
render() {
|
|
44
|
-
return html`
|
|
45
|
-
|
|
46
|
-
<p>Permanently delete the user account and data related to: ${this.email}</p>
|
|
47
|
-
|
|
48
|
-
<button
|
|
49
|
-
class="action-button deleteUser"
|
|
50
|
-
?disabled="${this.login === false}">Delete</button>
|
|
51
|
-
|
|
52
|
-
`;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/* Delete Account */
|
|
56
|
-
private alertDelete() { if (auth.currentUser) { this.deleteUser(); } else { alert('Please Login'); } }
|
|
57
|
-
private deleteUser() {
|
|
58
|
-
const d = confirm("Delete Account?");
|
|
59
|
-
if ( d == true ) { this.officialDelete(); console.log("user gone"); }
|
|
60
|
-
else { console.log("user here"); }
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Delete Declaration
|
|
64
|
-
private officialDelete = async () => {
|
|
65
|
-
|
|
66
|
-
if(auth.currentUser) {
|
|
67
|
-
|
|
68
|
-
return auth.currentUser.delete().then( () => { }).catch( () => { });
|
|
69
|
-
|
|
70
|
-
} else { alert('Please Sign-in') }
|
|
71
|
-
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
customElements.define('delete-user', DeleteUser);
|
|
77
|
-
|
|
78
|
-
declare global {
|
|
79
|
-
interface HTMLElementTagNameMap {
|
|
80
|
-
'delete-user': DeleteUser;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { CSSResultArray, LitElement, css, html } from "lit";
|
|
2
|
-
import { property, state } from "lit/decorators.js";
|
|
3
|
-
import { connect } from "pwa-helpers";
|
|
4
|
-
import store, { AppState } from "../../../store";
|
|
5
|
-
import { auth } from "../../../firebase/authentication";
|
|
6
|
-
import { labelStyle } from "../../../css/form/label";
|
|
7
|
-
import { inputStyle } from "../../../css/form/input";
|
|
8
|
-
import { buttonStyle } from "../../../css/form/button";
|
|
9
|
-
import { updateEmail } from "firebase/auth";
|
|
10
|
-
|
|
11
|
-
export class ContactEmail extends connect(store)(LitElement) {
|
|
12
|
-
|
|
13
|
-
/** @attr email */
|
|
14
|
-
@property({ type: String, reflect: true}) email = '';
|
|
15
|
-
|
|
16
|
-
@state() private login : boolean = false;
|
|
17
|
-
@state() private mail : string = "";
|
|
18
|
-
|
|
19
|
-
constructor() { super(); }
|
|
20
|
-
|
|
21
|
-
stateChanged(state: AppState) {
|
|
22
|
-
this.login = state.frontend!.login;
|
|
23
|
-
this.mail = state.backend!.email ;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Handle input changes to keep the password property in sync
|
|
27
|
-
private handleEmail(event: Event) {
|
|
28
|
-
const input = event.target as HTMLInputElement;
|
|
29
|
-
this.mail = input.value; // Update the property with the input value
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static get styles(): CSSResultArray { return [
|
|
33
|
-
labelStyle,
|
|
34
|
-
inputStyle,
|
|
35
|
-
buttonStyle,
|
|
36
|
-
css`
|
|
37
|
-
|
|
38
|
-
:host {
|
|
39
|
-
display: grid;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
form { display: grid; }
|
|
43
|
-
|
|
44
|
-
`
|
|
45
|
-
]; }
|
|
46
|
-
|
|
47
|
-
render() {
|
|
48
|
-
return html`
|
|
49
|
-
|
|
50
|
-
<form
|
|
51
|
-
autocomplete="off"
|
|
52
|
-
@submit="${this.default}">
|
|
53
|
-
|
|
54
|
-
<label for="pwa-email" >E-mail:</label>
|
|
55
|
-
|
|
56
|
-
<input
|
|
57
|
-
id = "pwa-email"
|
|
58
|
-
name = "email"
|
|
59
|
-
type = "email"
|
|
60
|
-
class = "email"
|
|
61
|
-
data-label = "Account Email"
|
|
62
|
-
@input = "${this.handleEmail}"
|
|
63
|
-
.value = "${this.mail}"/>
|
|
64
|
-
|
|
65
|
-
<button
|
|
66
|
-
class = "action-button"
|
|
67
|
-
@click = "${this.saveEmail}"
|
|
68
|
-
?disabled = "${this.login === false}">Update</button>
|
|
69
|
-
|
|
70
|
-
</form>
|
|
71
|
-
|
|
72
|
-
`;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/* Form Default */
|
|
76
|
-
private default = (e:Event) => {
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Save Email
|
|
81
|
-
private saveEmail = async () => {
|
|
82
|
-
if ( auth.currentUser ) {
|
|
83
|
-
|
|
84
|
-
let contactMail :any = this.shadowRoot?.querySelector('#pwa-email')!;
|
|
85
|
-
|
|
86
|
-
// Change Email Firebase Function
|
|
87
|
-
await updateEmail( auth.currentUser, contactMail.value ).catch((error:Error) => { console.log(error); });
|
|
88
|
-
|
|
89
|
-
// Verify Email Custom Event
|
|
90
|
-
const emailChangedEvent = new CustomEvent("userEmailChanged", {
|
|
91
|
-
detail: { email: contactMail.value }
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
// Dispatch Custom Event
|
|
95
|
-
window.dispatchEvent(emailChangedEvent);
|
|
96
|
-
|
|
97
|
-
alert('Email Updated');
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
customElements.define('contact-email', ContactEmail);
|
|
106
|
-
|
|
107
|
-
declare global {
|
|
108
|
-
interface HTMLElementTagNameMap {
|
|
109
|
-
'contact-email': ContactEmail;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
// this.emailVerification();
|
|
117
|
-
// let document :any = doc( db, 'users', auth.currentUser.uid );
|
|
118
|
-
// .then(() => updateDoc( document, { "contractorEmail":contactMail.email } ).catch(e=>console.log(e)) )
|
|
119
|
-
// store.dispatch( businessEmail(contactMail.email) ); // Redux Account Update
|
|
120
|
-
// console.log('good');
|
|
121
|
-
/*
|
|
122
|
-
// Email Verification
|
|
123
|
-
private emailVerification() {
|
|
124
|
-
|
|
125
|
-
// const auth : any = getAuth();
|
|
126
|
-
console.log( 'auth.currentUser: ', auth.currentUser);
|
|
127
|
-
|
|
128
|
-
// Todo: Find Soruce of Dependency
|
|
129
|
-
sendEmailVerification(auth.currentUser)
|
|
130
|
-
.then(() => { console.log('success')
|
|
131
|
-
// Email verification sent!
|
|
132
|
-
}).catch( e => console.log(e) );
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
*/
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { ref } from "@firebase/storage";
|
|
2
|
-
import { storage } from "../../../firebase/authentication";
|
|
3
|
-
/*
|
|
4
|
-
export const uploadIcon = (uploader, file) => {
|
|
5
|
-
|
|
6
|
-
const uploader = this.shadowRoot!.querySelector('#uploader');
|
|
7
|
-
const file = this.shadowRoot!.querySelector('#fileupload')!.files[0];
|
|
8
|
-
|
|
9
|
-
const now = storageRef.child('/images/' + file.name );
|
|
10
|
-
|
|
11
|
-
const task = now.put(file);
|
|
12
|
-
|
|
13
|
-
task.on('state_changed',
|
|
14
|
-
function progress(snapshot: object) { const percentage = ( snapshot.bytesTransferred / snapshot.totalBytes ) * 100; uploader.value = percentage },
|
|
15
|
-
// function error(error: object) { error },
|
|
16
|
-
// function complete() { }
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
this._imagePath = file.name;
|
|
20
|
-
console.log(this._imagePath);
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
*/
|
|
24
|
-
// Reference the total number of existing documents
|
|
25
|
-
export const _listImages = () => {
|
|
26
|
-
|
|
27
|
-
// Create a reference under which you want to list
|
|
28
|
-
const storageRef:any = ref(storage);
|
|
29
|
-
|
|
30
|
-
// Reference to list
|
|
31
|
-
const listRef = storageRef
|
|
32
|
-
.child('images/'); // .child('images/'+this._userID+'/'+);
|
|
33
|
-
|
|
34
|
-
// Find all the prefixes and items.
|
|
35
|
-
listRef
|
|
36
|
-
.listAll()
|
|
37
|
-
.then( (res:any) => {
|
|
38
|
-
|
|
39
|
-
console.log('res:', res);
|
|
40
|
-
|
|
41
|
-
res
|
|
42
|
-
.prefixes
|
|
43
|
-
.forEach( (folderRef:any) => {
|
|
44
|
-
console.log('folderRef: ', folderRef);
|
|
45
|
-
}); // You may call listAll() recursively on them. // All the prefixes under listRef.
|
|
46
|
-
|
|
47
|
-
res
|
|
48
|
-
.items
|
|
49
|
-
.forEach( (itemRef:any) => {
|
|
50
|
-
console.log('itemRef: ', itemRef);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
}).catch( (error:any) => { console.log("Could not get storage items: ", error)});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { CSSResultArray, LitElement, css, html } from "lit";
|
|
2
|
-
import { property, state } from "lit/decorators.js";
|
|
3
|
-
import { connect } from "pwa-helpers";
|
|
4
|
-
import { store, AppState } from "../../../store";
|
|
5
|
-
import { updateProfile } from "firebase/auth";
|
|
6
|
-
import { accName } from "../../../redux/backend";
|
|
7
|
-
import { auth } from "../../../firebase/authentication";
|
|
8
|
-
import { labelStyle } from "../../../css/form/label";
|
|
9
|
-
import { inputStyle } from "../../../css/form/input";
|
|
10
|
-
import { buttonStyle } from "../../../css/form/button";
|
|
11
|
-
|
|
12
|
-
export class InputName extends connect(store)(LitElement) {
|
|
13
|
-
|
|
14
|
-
/** @attr value */
|
|
15
|
-
@property({ type: String, reflect: true}) public value = '';
|
|
16
|
-
|
|
17
|
-
@state() private login : boolean = false;
|
|
18
|
-
|
|
19
|
-
constructor() { super(); }
|
|
20
|
-
|
|
21
|
-
stateChanged(state: AppState) {
|
|
22
|
-
this.login = state.frontend!.login;
|
|
23
|
-
this.value = state.backend!.name; // user-name
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static get styles(): CSSResultArray { return [
|
|
27
|
-
labelStyle,
|
|
28
|
-
inputStyle,
|
|
29
|
-
buttonStyle,
|
|
30
|
-
css`
|
|
31
|
-
|
|
32
|
-
:host, form { display: grid; }
|
|
33
|
-
|
|
34
|
-
` ]; }
|
|
35
|
-
|
|
36
|
-
render() {
|
|
37
|
-
return html`
|
|
38
|
-
|
|
39
|
-
<form
|
|
40
|
-
@submit="${this.default}">
|
|
41
|
-
|
|
42
|
-
<label
|
|
43
|
-
for="pwa-name"><span>Name:</span></label>
|
|
44
|
-
|
|
45
|
-
<input
|
|
46
|
-
id = "pwa-name"
|
|
47
|
-
name = "username"
|
|
48
|
-
type = "text"
|
|
49
|
-
data-label = "Contact Name"
|
|
50
|
-
@input = "${ this.handleInput }"
|
|
51
|
-
.value = "${ this.value }" />
|
|
52
|
-
|
|
53
|
-
<!-- Save to Database -->
|
|
54
|
-
<button
|
|
55
|
-
class="action-button save"
|
|
56
|
-
@click="${this.alertProfile}"
|
|
57
|
-
?disabled="${this.login === false}">Update</button>
|
|
58
|
-
|
|
59
|
-
</form>
|
|
60
|
-
|
|
61
|
-
`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* Form Default */
|
|
65
|
-
private default = (e:Event) => {
|
|
66
|
-
e.preventDefault();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Handle input changes to keep the password property in sync
|
|
70
|
-
private handleInput(event: Event) {
|
|
71
|
-
const input = event.target as HTMLInputElement;
|
|
72
|
-
this.value = input.value; // Update the property with the input value
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
private alertProfile = async () => {
|
|
76
|
-
|
|
77
|
-
// Dispatch the Information to Firestore Function
|
|
78
|
-
if (auth.currentUser) {
|
|
79
|
-
|
|
80
|
-
await updateProfile(auth.currentUser, { displayName: this.value })
|
|
81
|
-
.then( () => { store.dispatch(accName(this.value)) })
|
|
82
|
-
.then( () => { alert('updated name:' + this.value); });
|
|
83
|
-
|
|
84
|
-
} else { alert('Please Login'); }
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
// Redux Dispatch Updated Information
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
customElements.define('input-name', InputName);
|
|
94
|
-
|
|
95
|
-
declare global {
|
|
96
|
-
interface HTMLElementTagNameMap {
|
|
97
|
-
'input-name': InputName;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { CSSResultArray, LitElement, css, html } from "lit";
|
|
3
|
-
import { state } from "lit/decorators.js";
|
|
4
|
-
import { connect } from "pwa-helpers";
|
|
5
|
-
import store, { AppState } from "../../../store";
|
|
6
|
-
import { auth } from "../../../firebase/authentication";
|
|
7
|
-
import { labelStyle } from "../../../css/form/label";
|
|
8
|
-
import { inputStyle } from "../../../css/form/input";
|
|
9
|
-
import { buttonStyle } from "../../../css/form/button";
|
|
10
|
-
import { updatePassword } from "firebase/auth";
|
|
11
|
-
|
|
12
|
-
export class InputPassword extends connect(store)(LitElement) {
|
|
13
|
-
|
|
14
|
-
@state() private message : string = '';
|
|
15
|
-
@state() private password : string = '';
|
|
16
|
-
@state() private login : boolean = false;
|
|
17
|
-
|
|
18
|
-
constructor() { super(); }
|
|
19
|
-
|
|
20
|
-
protected firstUpdated() {
|
|
21
|
-
|
|
22
|
-
this.shadowRoot!.querySelector('.pass')!.addEventListener('click',() => {
|
|
23
|
-
this.alertPassword();
|
|
24
|
-
} );
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
stateChanged(state: AppState) {
|
|
29
|
-
this.login = state.frontend!.login;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Handle input changes to keep the password property in sync
|
|
33
|
-
private handleInputChange(event: Event) {
|
|
34
|
-
const input = event.target as HTMLInputElement;
|
|
35
|
-
this.password = input.value; // Update the property with the input value
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
static get styles(): CSSResultArray { return [
|
|
39
|
-
labelStyle,
|
|
40
|
-
inputStyle,
|
|
41
|
-
buttonStyle,
|
|
42
|
-
css`
|
|
43
|
-
|
|
44
|
-
:host{
|
|
45
|
-
display: grid;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
form { display: grid; }
|
|
49
|
-
|
|
50
|
-
p.error { color: red; }
|
|
51
|
-
|
|
52
|
-
` ]; }
|
|
53
|
-
|
|
54
|
-
render() {
|
|
55
|
-
return html`
|
|
56
|
-
|
|
57
|
-
<form
|
|
58
|
-
autocomplete="off"
|
|
59
|
-
@submit="${this.default}">
|
|
60
|
-
|
|
61
|
-
<!-- Input - 1 -->
|
|
62
|
-
<label for="pwa-new-password">New Password</label>
|
|
63
|
-
|
|
64
|
-
<input
|
|
65
|
-
id = "pwa-new-password"
|
|
66
|
-
name = "new_password"
|
|
67
|
-
type = "password"
|
|
68
|
-
.value = "${this.password}"
|
|
69
|
-
@input = "${this.handleInputChange}"
|
|
70
|
-
aria-describedby = "password-help">
|
|
71
|
-
|
|
72
|
-
<!-- Input - 2 -->
|
|
73
|
-
<label for="pwa-verify-password">Verify Password</label>
|
|
74
|
-
|
|
75
|
-
<input
|
|
76
|
-
id = "pwa-verify-password"
|
|
77
|
-
name = "verify_password"
|
|
78
|
-
type = "password">
|
|
79
|
-
|
|
80
|
-
<!-- Submit -->
|
|
81
|
-
<button
|
|
82
|
-
class="action-button pass"
|
|
83
|
-
?disabled="${this.login === false}">Update</button>
|
|
84
|
-
|
|
85
|
-
${this.message ? html`
|
|
86
|
-
|
|
87
|
-
<p
|
|
88
|
-
class=${this.message.includes('Password entered') ? '' : 'error'}
|
|
89
|
-
aria-live="polite">
|
|
90
|
-
|
|
91
|
-
${this.message}
|
|
92
|
-
|
|
93
|
-
</p>
|
|
94
|
-
|
|
95
|
-
` : ''
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
</form>
|
|
99
|
-
|
|
100
|
-
`;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/* Form Default */
|
|
104
|
-
private default = (e:Event) => {
|
|
105
|
-
e.preventDefault();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/* Update Password */
|
|
109
|
-
private alertPassword() {
|
|
110
|
-
|
|
111
|
-
if (!this.password) {
|
|
112
|
-
this.message = 'Please enter a password';
|
|
113
|
-
} else if (this.password.length < 8) {
|
|
114
|
-
this.message = 'Password must be at least 8 characters long';
|
|
115
|
-
} else {
|
|
116
|
-
this.message = `Password entered:`;
|
|
117
|
-
|
|
118
|
-
if (!/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/.test(this.password)) {
|
|
119
|
-
this.message = 'Password must include letters, numbers, and be 8+ characters';
|
|
120
|
-
} else {
|
|
121
|
-
|
|
122
|
-
if (auth.currentUser) { this.updatePass(this.password); }
|
|
123
|
-
else { alert('Please Login'); }
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Firebase Password Function
|
|
132
|
-
private updatePass = async (newPassword:any) => {
|
|
133
|
-
|
|
134
|
-
if (auth.currentUser) {
|
|
135
|
-
|
|
136
|
-
// Update new password
|
|
137
|
-
await updatePassword ( auth.currentUser, newPassword )
|
|
138
|
-
.then ( () => { console.log("Password successful!"); })
|
|
139
|
-
.catch ( (error) => { console.log("Problem: "+ error.messge) }); //alertPassword(error); });
|
|
140
|
-
|
|
141
|
-
} else { alert('Please Login'); }
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
customElements.define('input-password', InputPassword);
|
|
148
|
-
|
|
149
|
-
declare global {
|
|
150
|
-
interface HTMLElementTagNameMap {
|
|
151
|
-
'input-password': InputPassword;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
// grid-template-rows: auto auto auto auto auto;
|