You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2016/09/19 19:45:42 UTC

[4/4] wicket git commit: WICKET-6242 Improved synchronization for signIn. Added missing header license.

WICKET-6242 Improved synchronization for signIn. Added missing header license.


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/5e1ced34
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/5e1ced34
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/5e1ced34

Branch: refs/heads/master
Commit: 5e1ced34e30135f3e46c9ab8cea1b8137f72ca8d
Parents: 91b9dba
Author: Andrea Del Bene <ad...@apache.org>
Authored: Tue Sep 13 12:37:59 2016 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Sep 19 21:40:27 2016 +0200

----------------------------------------------------------------------
 .../authentication/AuthenticatedWebSession.java     | 14 ++++----------
 .../authentication/AuthenticatedWebSessionTest.java | 16 ++++++++++++++++
 2 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/5e1ced34/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java
----------------------------------------------------------------------
diff --git a/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java b/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java
index 4e3851e..681236a 100644
--- a/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java
+++ b/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java
@@ -63,17 +63,11 @@ public abstract class AuthenticatedWebSession extends AbstractAuthenticatedWebSe
 	 */
 	public final boolean signIn(final String username, final String password)
 	{
-		if (signedIn.compareAndSet(false, true))
+		boolean authenticated = authenticate(username, password);
+
+		if (authenticated && signedIn.compareAndSet(false, true))
 		{
-			boolean authenticated = authenticate(username, password);
-			if (authenticated)
-			{
-				bind();
-			}
-			else
-			{
-				signedIn.set(false);
-			}
+			bind();
 		}
 		return signedIn.get();
 	}

http://git-wip-us.apache.org/repos/asf/wicket/blob/5e1ced34/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java
----------------------------------------------------------------------
diff --git a/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java b/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java
index c444d81..d91dd9d 100644
--- a/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java
+++ b/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.wicket.authroles.authentication;
 
 import static java.util.Locale.getDefault;