fixed bug with verifying email showing previous account. Fixed sharing file through email. Added new cookie when verifying email. Removed get storage. Fixed changing password. Added refresh page after verifying email. Added more swal errors when trying to share email without sharing file first and more

This commit is contained in:
kyle hoell
2020-12-03 18:52:39 -05:00
parent 50c2dfa9b6
commit e27f5a9176
8 changed files with 70 additions and 20 deletions
+2
View File
@@ -10,6 +10,8 @@ export const startSetStorage = () => {
return (dispatch) => {
return;
if (env.disableStorage === "true") {
return;
}
+1 -1
View File
@@ -35,6 +35,7 @@ const LoginPage = (props) => {
<div class="confirm__email">
<h2>Confirm your email address</h2>
<p>We've sent a confirmation email to <span>{env.emailAddress ? env.emailAddress.length !== 0 ? env.emailAddress : props.state.email : props.state.email}</span>.</p>
<p>Refresh this page after confirming email.</p>
<form action="">
{/* <div class="group__input">
<input type="text" placeholder="Enter one-time PIN"/>
@@ -153,7 +154,6 @@ const LoginPage = (props) => {
<div class="checkemail__pass" style={{display:"none"}}>
<h2>Check your email</h2>
<p>If the email address matches any in our database, well send you an email with instructions on how to reset your password</p>
<p>If you still have problems accessing your account, please send an email to support@piedpiperapp.com</p>
</div>
</div>
+7
View File
@@ -5,6 +5,7 @@ import {connect} from "react-redux";
import React from "react";
import axios from "../../axiosInterceptor";
import Swal from "sweetalert2";
import env from "../../enviroment/envFrontEnd";
class LoginPageContainer extends React.Component {
@@ -224,7 +225,13 @@ class LoginPageContainer extends React.Component {
componentDidMount = () => {
env.emailAddress = "";
this.setState(() => ({
...this.state,
email: "",
}))
this.loginWithToken();
}
render() {
+2 -2
View File
@@ -537,8 +537,8 @@ class SettingsPageContainer extends React.Component {
axios.post(`/user-service/change-password/`, data).then((results) => {
const newToken = results.data;
window.localStorage.setItem("token", newToken);
//const newToken = results.data;
// window.localStorage.setItem("token", newToken);
this.changeShowChangePassword()
//this.getUserDetails()
+35 -1
View File
@@ -44,7 +44,7 @@ class ShareModelContainer extends React.Component {
const linkType = response.data.metadata.linkType;
const shareURL = this.props.shareSelected.metadata.drive ? response.data.metadata.link : `/download-page/${this.props.shareSelected._id}/${this.props.shareSelected.metadata.link}`
const shareURL = this.props.shareSelected.metadata.drive ? response.data.metadata.link : `${currentURL}/download-page/${this.props.shareSelected._id}/${this.props.shareSelected.metadata.link}`
console.log("share link type", linkType, response.data);
@@ -123,6 +123,15 @@ class ShareModelContainer extends React.Component {
if (this.state.sendTo.length === 0 || !this.state.loaded) return;
if (!this.state.shared) {
Swal.fire({
icon: 'error',
title: 'You must share the file first',
text: 'Select make public or make one time before sending email',
})
return;
}
console.log("sending email share request")
const data = {
@@ -146,6 +155,11 @@ class ShareModelContainer extends React.Component {
}).catch((err) => {
console.log("share file email failed", err)
Swal.fire({
icon: 'error',
title: 'Cannot send share email',
text: 'An error occurred when sending share email',
})
})
}
@@ -242,6 +256,11 @@ class ShareModelContainer extends React.Component {
}).catch((err) => {
console.log(err)
Swal.fire({
icon: 'error',
title: 'Cannot remove public link',
text: 'An error occurred when removing public link',
})
})
}
@@ -295,6 +314,11 @@ class ShareModelContainer extends React.Component {
}).catch((err) => {
console.log(err)
Swal.fire({
icon: 'error',
title: 'Cannot make public',
text: 'An error occurred when making file public'
})
})
}
})
@@ -350,6 +374,11 @@ class ShareModelContainer extends React.Component {
}).catch((err) => {
console.log(err)
Swal.fire({
icon: 'error',
title: 'Cannot make one time public link',
text: 'An error occurred when making one time public link',
})
})
@@ -382,6 +411,11 @@ class ShareModelContainer extends React.Component {
}}))
}).catch((err) => {
console.log(err)
Swal.fire({
icon: 'error',
title: 'Cannot remove public link',
text: 'An error occurred when removing public link',
})
})
}