From 9e87ca6cd56ad499045ccb5185fd45d4472c41e9 Mon Sep 17 00:00:00 2001 From: Seyi Adebajo Date: Tue, 28 Mar 2017 01:19:31 -0700 Subject: [PATCH] DSS-6551 Fixes issue with play session cookie not containing username. Small updates to wordinng in Ownership ui --- web/app/controllers/Application.java | 5 ++++- wherehows-web/app/templates/components/dataset-author.hbs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/app/controllers/Application.java b/web/app/controllers/Application.java index 816189793b..281a8440d3 100644 --- a/web/app/controllers/Application.java +++ b/web/app/controllers/Application.java @@ -193,6 +193,8 @@ public class Application extends Controller return badRequest("Missing or invalid [credentials]"); } + session().clear(); + // Create a uuid string for this session if one doesn't already exist // to be appended to the Result object String uuid = session("uuid"); @@ -207,8 +209,9 @@ public class Application extends Controller return badRequest("Invalid credentials"); } - session().clear(); + // Adds the username to the session cookie + session("user", username); // Contruct an ObjectNode with the username and uuid token to be sent with the response ObjectNode data = Json.newObject(); data.put("username", username); diff --git a/wherehows-web/app/templates/components/dataset-author.hbs b/wherehows-web/app/templates/components/dataset-author.hbs index 4946c67de4..6ad760ace2 100644 --- a/wherehows-web/app/templates/components/dataset-author.hbs +++ b/wherehows-web/app/templates/components/dataset-author.hbs @@ -2,10 +2,10 @@