diff --git a/src/dev/peerat/framework/RouteMapper.java b/src/dev/peerat/framework/RouteMapper.java index 7703e61..293b6e2 100644 --- a/src/dev/peerat/framework/RouteMapper.java +++ b/src/dev/peerat/framework/RouteMapper.java @@ -22,6 +22,7 @@ public class RouteMapper{ public void register(Object instance, Method method, Route route){ int length = states.length+1; + method.setAccessible(true); this.states = addElement(states, new RouteState[length], new RouteState(instance, method, route)); if(this.calls != null) this.calls = new int[length]; } diff --git a/src/dev/peerat/framework/auth/JwtAuthenticator.java b/src/dev/peerat/framework/auth/JwtAuthenticator.java index e4c284e..850b66f 100644 --- a/src/dev/peerat/framework/auth/JwtAuthenticator.java +++ b/src/dev/peerat/framework/auth/JwtAuthenticator.java @@ -81,14 +81,14 @@ public class JwtAuthenticator implements Authenticator{ @Override public U getUser(RequestType type, HttpReader reader) throws Exception{ String auth = reader.getHeader("Authorization"); - if(auth == null) throw new AuthException("Header 'Authorization' notfound"); + if(auth == null) return null; auth = auth.substring(7); return this.userCreator.apply(this.jwtConsumer.processToClaims(auth)); } @Override public U getUser(String data) throws Exception { - if(data == null) throw new AuthException("Null Token"); + if(data == null) return null; return this.userCreator.apply(this.jwtConsumer.processToClaims(data)); }