Skip to content

Commit

Permalink
Ignore requiresAuth attribute in RestInterfaceClient. Fixes #1648.
Browse files Browse the repository at this point in the history
Replaces #1649.

(cherry picked from commit 992d699)
  • Loading branch information
s-ludwig committed Feb 2, 2017
1 parent c2fa38f commit 66533d7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion source/vibe/web/internal/rest/common.d
Expand Up @@ -250,7 +250,9 @@ import std.meta : anySatisfy, Filter;

StaticRoute[routeCount] ret;

alias AUTHTP = AuthInfo!TImpl;
static if (is(TImpl == class))
alias AUTHTP = AuthInfo!TImpl;
else alias AUTHTP = void;

foreach (fi, func; RouteFunctions) {
StaticRoute route;
Expand Down Expand Up @@ -684,3 +686,13 @@ unittest {
assert(baz.routes[1].fullPattern == "/bar/:barid/baz/test2");
assert(baz.routes[1].pathHasPlaceholders);
}

unittest { // #1648
import vibe.web.auth;

@requiresAuth
interface I {
void a();
}
alias RI = RestInterface!I;
}

0 comments on commit 66533d7

Please sign in to comment.