Throw forbidden exception while temporary token expired

pull/755/head
johnniang 2019-11-30 15:53:52 +08:00
parent 60cac1313e
commit a3bffe67a7
1 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import org.springframework.util.Assert;
import org.springframework.web.filter.OncePerRequestFilter;
import run.halo.app.cache.StringCacheStore;
import run.halo.app.config.properties.HaloProperties;
import run.halo.app.exception.ForbiddenException;
import run.halo.app.exception.NotInstallException;
import run.halo.app.model.properties.PrimaryProperties;
import run.halo.app.model.support.HaloConst;
@ -183,7 +184,7 @@ public abstract class AbstractAuthenticationFilter extends OncePerRequestFilter
if (!tokenCountOptional.isPresent()) {
// If the token is not found
return false;
throw new ForbiddenException("The temporary token has been expired").setErrorData(tempToken);
}
log.info("Got valid temp token: [{}]", tempToken);