Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = 'pl.databucket'
version = '3.4.2'
version = '3.4.3'
targetCompatibility = 8
sourceCompatibility = 8

Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"homepage": ".",
"name": "databucket",
"version": "3.4.2",
"version": "3.4.3",
"private": true,
"dependencies": {
"@material-ui/core": "4.12.4",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/dialogs/InfoDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function InfoDialog() {
>
<img style={{marginLeft: '100px', marginTop: '20px'}} src={DatabucketLogo} alt='' width='399' height='65'/>
<div style={{margin: '20px'}}>
<Typography color='secondary'>Version: <b>3.4.2</b></Typography>
<Typography color='secondary'>Version: <b>3.4.3</b></Typography>
<Link target='_blank' href='https://www.databucket.pl' color="primary">www.databucket.pl</Link><br/>
<Link target='_blank' href='https://github.com/databucket/databucket-server' color="textSecondary">Source code</Link><br/>
<Link target='_blank' href='https://github.com/databucket/databucket-server/wiki' color="textSecondary">Documentation</Link><br/>
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/components/public/LoginPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,12 @@ export default function LoginPage() {
return getProjectsPaper();
case 2:
const pathname = getPathname();
if (pathname != null && pathname !== "null") {
if (pathname != null
&& pathname !== "null"
&& !pathname.includes("confirmation")
&& !pathname.includes("forgot-password")
&& !pathname.includes("sign-up")
) {
setPathname(null);
return redirectTo(pathname)
} else {
Expand All @@ -291,7 +296,7 @@ export default function LoginPage() {
<div className="ContainerClass">
{<img src={Logo} alt=''/>}
{paper()}
<Typography variant="caption">3.4.2</Typography>
<Typography variant="caption">3.4.3</Typography>
<MessageBox
config={messageBox}
onClose={() => setMessageBox({...messageBox, open: false})}
Expand Down
20 changes: 13 additions & 7 deletions frontend/src/components/public/SignUpPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Link from "@material-ui/core/Link";
import {Redirect} from "react-router-dom";
import {validateEmail} from "../../utils/Misc";
import {getBaseUrl, getContextPath} from "../../utils/UrlBuilder";
import {handleLoginErrors} from "../../utils/FetchHelper";
import {handleErrors, handleLoginErrors} from "../../utils/FetchHelper";

export default function SignUpPage() {

Expand Down Expand Up @@ -83,6 +83,7 @@ export default function SignUpPage() {
}

const submitData = token => {
let errorResp = false;
const payload = {
username: username,
email: email,
Expand All @@ -96,15 +97,20 @@ export default function SignUpPage() {
body: JSON.stringify(payload),
headers: {'Content-Type': 'application/json'}
})
.then(handleLoginErrors)
.then(res => res.json())
.then(res => {
setLoading(false);
setMessageBox({open: true, severity: 'info', title: 'Send confirmation email', message: ""});
})
.then(handleErrors)
.catch(error => {
errorResp = true;
setLoading(false);
setMessageBox({open: true, severity: 'error', title: 'Registration failed', message: error});
})
.then(() => {
if (!errorResp) {
setLoading(false);
setMessageBox({open: true, severity: 'info', title: 'Send confirmation email', message: ""});
setTimeout(() => {
setBack(true);
}, 6000)
}
});
}

Expand Down
8 changes: 4 additions & 4 deletions frontend/src/route/AppRouter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import {BrowserRouter, Redirect, Switch} from 'react-router-dom';
import {BrowserRouter, Redirect, Route, Switch} from 'react-router-dom';
import LoginPage from '../components/public/LoginPage';
import NotFoundPage from '../components/NotFoundPage';
import PublicRoute from './PublicRoute'
Expand Down Expand Up @@ -27,9 +27,9 @@ export default function AppRouter() {
<Switch>
<Redirect exact from='/' to={getProjectDataPath()}/>
<PublicRoute exact restricted={true} path="/login" component={LoginPage}/>
<PublicRoute exact restricted={true} path="/forgot-password" component={ForgotPasswordPage}/>
<PublicRoute exact restricted={true} path="/sign-up" component={SignUpPage}/>
<PublicRoute exact restricted={true} path="/confirmation/*" component={ConfirmationPage}/>
<Route exact restricted={true} path="/forgot-password" component={ForgotPasswordPage}/>
<Route exact restricted={true} path="/sign-up" component={SignUpPage}/>
<Route path="/confirmation/*" component={ConfirmationPage}/>
<ChangePasswordRoute exact path="/change-password" component={ChangePasswordPage}/>
<ManagementRoute path="/management" component={_ManagementTabs}/>
<ProjectRoute path="/project" component={_ProjectRouteInternal}/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Docket confDataContext() {
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Databucket API")
.version("3.4.2")
.version("3.4.3")
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public ResponseEntity<?> signUp(@RequestBody SignUpDtoRequest signUpDtoRequest)
return exceptionFormatter.customPublicException("Given email already exists", HttpStatus.CONFLICT);

manageUserService.signUpUser(signUpDtoRequest);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
return exceptionFormatter.responseMessage("An account has been created for a new user", HttpStatus.CREATED);
} catch (MessagingException | MailSendException e) {
return exceptionFormatter.customException("Mail service exception!", HttpStatus.SERVICE_UNAVAILABLE);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,10 @@ public ResponseEntity<Map<String, Object>> customPublicException(String message,
return new ResponseEntity<>(response, status);
}

public ResponseEntity<Map<String, Object>> responseMessage(String message, HttpStatus status) {
Map<String, Object> response = new HashMap<>();
response.put("message", message);
return new ResponseEntity<>(response, status);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ protected void configure(HttpSecurity http) throws Exception {
"/actuator/**",
"/**/favicon.ico",
"/login",
"/confirmation/**",
"/forgot-password",
"/sign-up",
"/change-password",
"/project",
"/project/**",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ public void forgotPasswordMessage(ForgotPasswordReqDTO forgotPasswordReqDTO) thr

public User modifyUser(ManageUserDtoRequest manageUserDtoRequest) {
User user = userRepository.findByUsername(manageUserDtoRequest.getUsername());

// clear last send email dates when changed email address
if (!user.getEmail().equals(manageUserDtoRequest.getEmail())) {
user.setLastSendEmailForgotPasswordLinkDate(null);
user.setLastSendEmailTempPasswordDate(null);
}

user.setEmail(manageUserDtoRequest.getEmail());
user.setDescription(manageUserDtoRequest.getDescription());
user.setEnabled(manageUserDtoRequest.isEnabled());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ public List<Long> reserveData(User user, Bucket bucket, QueryRule queryRule, Int
Map<String, Object> updateNamedParams = new HashMap<>();
updateNamedParams.put(COL.RESERVED_BY, targetOwnerUsername);
updateNamedParams.put(COL.MODIFIED_BY, user.getUsername());
updateNamedParams.put(COL.MODIFIED_AT, new java.sql.Timestamp(new java.util.Date().getTime()));
updateNamedParams.put(COL.RESERVED, true);

Query updateQuery = new Query(bucket.getTableName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public void sendConfirmationLink(User user, String link, String from) throws Mes
htmlContent += "<p>If you didn't request a registration, don't worry. You can safely ignore this email.</p><br/><br/>";

MailSenderHandler mailHandler = new MailSenderHandler(sender);
mailHandler.setFrom(from);
if (from != null)
mailHandler.setFrom(from);
mailHandler.setTo(user.getEmail());
mailHandler.setSubject("Databucket account - registration");
mailHandler.setText(htmlContent, true);
Expand All @@ -37,7 +38,8 @@ public void sendRegistrationConfirmation(User user, String from) throws Messagin
htmlContent += "<p>Log in to the application and request to be assigned to the project.</p>";

MailSenderHandler mailHandler = new MailSenderHandler(sender);
mailHandler.setFrom(from);
if (from != null)
mailHandler.setFrom(from);
mailHandler.setTo(user.getEmail());
mailHandler.setSubject("Databucket account - activated");
mailHandler.setText(htmlContent, true);
Expand All @@ -56,7 +58,8 @@ public void sendForgotPasswordLink(User user, String link, String from) throws M
htmlContent += "<p>If you didn't request a reset, don't worry. You can safely ignore this email.</p><br/><br/>";

MailSenderHandler mailHandler = new MailSenderHandler(sender);
mailHandler.setFrom(from);
if (from != null)
mailHandler.setFrom(from);
mailHandler.setTo(user.getEmail());
mailHandler.setSubject("Databucket account - forgot your password?");
mailHandler.setText(htmlContent, true);
Expand All @@ -70,7 +73,8 @@ public void sendNewPassword(User user, String password, String from) throws Mess
htmlContent += "<h2>" + password + "</h2>";

MailSenderHandler mailHandler = new MailSenderHandler(sender);
mailHandler.setFrom(from);
if (from != null)
mailHandler.setFrom(from);
mailHandler.setTo(user.getEmail());
mailHandler.setSubject("Databucket account - temporary password");
mailHandler.setText(htmlContent, true);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/banner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
██████╔╝██║ ██║ ██║ ██║ ██║██████╔╝╚██████╔╝╚██████╗██║ ██╗███████╗ ██║ ██████╔╝
╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═════╝

Databucket version: (v3.4.2)
Databucket version: (v3.4.3)
Spring Boot version:${spring-boot.formatted-version}