Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(firebaseHelper, postId) {
this.firebaseHelper = firebaseHelper;
// List of all times running on the page.
this.timers = [];
// Firebase SDK.
this.auth = firebase.auth();
// Pointers to DOM elements.
this.postElement = $(Post.createPostHtml(postId));
MaterialUtils.upgradeTextFields(this.postElement);
this.toast = $('.mdl-js-snackbar');
this.theatre = $('.fp-theatre');
// Adds the element to the main UI if thisis the first time this is called.
if ($('.fp-image-container', '#page-post').children().length === 0) {
$('.fp-image-container', '#page-post').append(this.postElement);
}
}
checkEULAAgreement() {
return firebase
.ref(`/users/${firebase.auth().currentUser.uid}/acceptedEULA`)
.once("value")
.then(data => data.val());
}
useEffect(() => {
fetchUser(firebase.auth());
return () => undefined;
}, []);
concatMap(async () => {
await firebase.auth().signOut();
return new SignOutSuccess();
}),
catchError(error => of(new SignOutFail(error)))
resetPassword(email: string) {
const fbAuth = firebase.auth();
return fbAuth.sendPasswordResetEmail(email)
.then(() => this.notify.update('Password update email sent', 'info'))
.catch((error) => this.handleError(error));
}
public render() {
const user = firebase.auth().currentUser || {} as any;
const { event, classes, processingReservation } = this.props;
return (
}
title={
{event.title}
}
subheader={{event.price ? `P${event.price}` : 'Free'}}
/>
private get collection(): firebase.firestore.CollectionReference {
return firebase
.firestore()
.collection("users")
.doc((firebase.auth().currentUser as firebase.User).uid)
.collection("projects");
}
}
render() {
const { loading, user } = this.props.user;
if (loading && !user) {
return (
);
} else if (user) {
return (
);
} else {
return (
);
}
}
}
handleLogout() {
firebase.auth().signOut().then(() => {
this.setState({
user: null,
faves: [],
});
});
}
export const mine = (ref: firebase.firestore.Query) =>
ref.where('uid', '==', (firebase.auth().currentUser as firebase.User).uid);