mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
fix logout with enabled anonymous access
This commit is contained in:
@@ -195,15 +195,10 @@ public class AuthenticationResource
|
|||||||
|
|
||||||
Response resp = null;
|
Response resp = null;
|
||||||
|
|
||||||
// TODO handle anonymous access
|
if (configuration.isAnonymousAccessEnabled())
|
||||||
|
|
||||||
User user = null;
|
|
||||||
|
|
||||||
if (user != null)
|
|
||||||
{
|
{
|
||||||
ScmState state = createState(subject);
|
|
||||||
|
|
||||||
resp = Response.ok(state).build();
|
resp = Response.ok(createAnonymousState()).build();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -272,11 +267,8 @@ public class AuthenticationResource
|
|||||||
}
|
}
|
||||||
else if (configuration.isAnonymousAccessEnabled())
|
else if (configuration.isAnonymousAccessEnabled())
|
||||||
{
|
{
|
||||||
User user = new User(SCMContext.USER_ANONYMOUS, "SCM Anonymous",
|
|
||||||
"scm-anonymous@scm-manager.com");
|
|
||||||
ScmState state = createState(user, Collections.EMPTY_LIST);
|
|
||||||
|
|
||||||
response = Response.ok(state).build();
|
response = Response.ok(createAnonymousState()).build();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -288,6 +280,20 @@ public class AuthenticationResource
|
|||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private ScmState createAnonymousState()
|
||||||
|
{
|
||||||
|
User user = new User(SCMContext.USER_ANONYMOUS, "SCM Anonymous",
|
||||||
|
"scm-anonymous@scm-manager.com");
|
||||||
|
|
||||||
|
return createState(user, Collections.EMPTY_LIST);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user