Epic cleanup and code shuffle in tests to avoid warnings
[catagits/Catalyst-Plugin-Authentication.git] / t / lib / RemoteTestApp2 / Controller / Root.pm
diff --git a/t/lib/RemoteTestApp2/Controller/Root.pm b/t/lib/RemoteTestApp2/Controller/Root.pm
new file mode 100644 (file)
index 0000000..dfbcd46
--- /dev/null
@@ -0,0 +1,28 @@
+package RemoteTestApp2::Controller::Root;
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config(namespace => '');
+
+sub default : Local {
+    my ( $self, $c ) = @_;
+    if ($c->authenticate()) {
+        $c->res->body(
+              'my_user_name:'
+              . $c->user->{my_user_name}
+        );
+    }
+    else {
+        $c->res->body('FAIL');
+        $c->res->status(403);
+    }
+}
+
+sub public : Local {
+    my ( $self, $c ) = @_;
+    $c->res->body('OK');
+}
+
+1;
+