Split rest authentication into two. For web apps integration url is /c/restful/
This commit is contained in:
@@ -18,7 +18,11 @@ abstract public class ClientException extends WiseMappingException {
|
||||
String getMsgBundleKey();
|
||||
|
||||
public String getMessage(@NotNull final MessageSource messageSource, final @NotNull Locale locale) {
|
||||
return messageSource.getMessage(this.getMsgBundleKey(), null, locale);
|
||||
return messageSource.getMessage(this.getMsgBundleKey(), this.getMsgBundleArgs(), locale);
|
||||
}
|
||||
|
||||
protected Object[] getMsgBundleArgs(){
|
||||
return null;
|
||||
}
|
||||
|
||||
public Severity getSeverity() {
|
||||
|
@@ -35,4 +35,9 @@ public class MultipleSessionsOpenException
|
||||
protected String getMsgBundleKey() {
|
||||
return MSG_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object[] getMsgBundleArgs() {
|
||||
return new String[]{"you"};
|
||||
}
|
||||
}
|
||||
|
@@ -18,17 +18,15 @@
|
||||
|
||||
package com.wisemapping.exceptions;
|
||||
|
||||
import com.wisemapping.model.Collaborator;
|
||||
import com.wisemapping.model.User;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class SessionExpiredException
|
||||
extends ClientException {
|
||||
public static final String MSG_KEY = "MINDMAP_TIMESTAMP_OUTDATED";
|
||||
@Nullable
|
||||
private Collaborator lastUpdater;
|
||||
private User lastUpdater;
|
||||
|
||||
public SessionExpiredException(@Nullable Collaborator lastUpdater) {
|
||||
public SessionExpiredException(@NotNull User lastUpdater) {
|
||||
super("Map has been updated by " + (lastUpdater != null ? lastUpdater.getEmail() : ""), Severity.FATAL);
|
||||
this.lastUpdater = lastUpdater;
|
||||
}
|
||||
@@ -38,4 +36,9 @@ public class SessionExpiredException
|
||||
protected String getMsgBundleKey() {
|
||||
return MSG_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object[] getMsgBundleArgs() {
|
||||
return new String[]{lastUpdater.getFullName() + "<" + lastUpdater.getEmail() + ">"};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user