},
);
+# Matches user above so we can test against a detach and confirm
+# it gets skipped and auths in 'members' realm
+our $detach_test_info = {
+ 'user' => 'bob',
+ 'password' => 's00p3r',
+ 'realm_to_pass' => 'members',
+};
+
__PACKAGE__->config('Plugin::Authentication' => {
default_realm => 'progressive',
progressive => {
$c->res->body("ok");
}
+sub progressive_detach : Local {
+ my ( $self, $c ) = @_;
+
+ my $realm = $AuthRealmTestAppProgressive::detach_test_info->{realm_to_pass};
+ my $user = $AuthRealmTestAppProgressive::detach_test_info->{user};
+ my $pass = $AuthRealmTestAppProgressive::detach_test_info->{password};
+ my $res;
+ my $ok = eval {
+ $res = $c->authenticate( { username => $user, password => $pass }, );
+ 1;
+ };
+ ok( !$@, "authentication passed skipping detach." );
+ ok( $ok, "user authenticated skipping detach" );
+ ok( $c->user_in_realm($realm), "user in proper realm" );
+ $c->res->body("ok");
+}
1;
use Catalyst::Test qw/AuthRealmTestAppProgressive/;
ok(get("/progressive"), "get ok");
+ok(get("/progressive_detach"), "get ok");
done_testing;