feat: password reset and firebase security
This commit is contained in:
@@ -62,6 +62,7 @@ class RegisterFormBase extends Component {
|
||||
})
|
||||
const { user } = result
|
||||
console.log(user)
|
||||
user.sendEmailVerification()
|
||||
firebase.db
|
||||
.collection("users")
|
||||
.doc(user.uid)
|
||||
|
||||
@@ -122,7 +122,7 @@ class Search extends Component {
|
||||
`}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
) : entries.length > 0 ? (
|
||||
entries.map((entry, index) => (
|
||||
<Link
|
||||
key={index}
|
||||
@@ -150,6 +150,17 @@ class Search extends Component {
|
||||
</SearchResult>
|
||||
</Link>
|
||||
))
|
||||
) : (
|
||||
<div
|
||||
css={css`
|
||||
text-align: center;
|
||||
font-style: italic;
|
||||
color: ${theme.colors.tertiary};
|
||||
margin-top: 5px;
|
||||
`}
|
||||
>
|
||||
No entries to display
|
||||
</div>
|
||||
)}
|
||||
</SearchGrid>
|
||||
</SearchLayout>
|
||||
|
||||
@@ -86,16 +86,43 @@ class User extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { authUser, theme } = this.props
|
||||
const { authUser, theme, firebase } = this.props
|
||||
const { exporting, files } = this.state
|
||||
return (
|
||||
<ProfileGrid>
|
||||
<ProfileSection>
|
||||
<ProfileSectionHeader>
|
||||
User: <ProfileSectionText>{authUser.email}</ProfileSectionText>
|
||||
<div>
|
||||
<ProfileSectionText style={{ fontWeight: 400 }}>
|
||||
{authUser.emailVerified
|
||||
? "Email has been verified"
|
||||
: "Email not verified"}
|
||||
</ProfileSectionText>
|
||||
</div>
|
||||
</ProfileSectionHeader>
|
||||
<SignOut />
|
||||
</ProfileSection>
|
||||
<ProfileSection>
|
||||
<ProfileSectionHeader>
|
||||
Reset Password{" "}
|
||||
<div>
|
||||
<ProfileSectionText style={{ fontWeight: 400 }}>
|
||||
send an email with reset instructions
|
||||
</ProfileSectionText>
|
||||
</div>
|
||||
</ProfileSectionHeader>
|
||||
|
||||
<Button
|
||||
colors={theme.colors}
|
||||
onClick={() => {
|
||||
console.log("reset!")
|
||||
firebase.doPasswordReset(authUser.email)
|
||||
}}
|
||||
>
|
||||
Send Reset
|
||||
</Button>
|
||||
</ProfileSection>
|
||||
<ProfileSection>
|
||||
<ProfileSectionHeader>
|
||||
Export Journal Entries{" "}
|
||||
|
||||
Reference in New Issue
Block a user