Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass authentication problem - redux #31

Open
cwirtanen opened this issue May 9, 2018 · 0 comments
Open

First pass authentication problem - redux #31

cwirtanen opened this issue May 9, 2018 · 0 comments

Comments

@cwirtanen
Copy link

Appear to be having the same problem as #10 which was fixed a while back.

Running Mango 1.30 and Mojolicious 7.77.

My first query to MongoDB gives me an authentication error: not authorized for query on test.testcollection at /usr/local/share/perl5/Mango/Cursor/Query.pm line 112

Subsequent queries work fine.


use Mojolicious::Lite;
use Mango;

@ARGV = qw(daemon --listen http://*:5000);

my $muri = 'mongodb://user:pass@localhost/test';
my $mango = Mango->new($muri);

get '/' => sub {
    my $c = shift;
    my $pos = $mango->db->collection('testcollection')->find->all;
    $c->render('json' => $pos);
};
app->start;

Server available at http://127.0.0.1:5000
[Wed May  9 02:15:48 2018] [debug] GET "/"
[Wed May  9 02:15:48 2018] [debug] Routing to a callback
[Wed May  9 02:15:48 2018] [error] not authorized for query on test.testcollection at /usr/local/share/perl5/Mango/Cursor/Query.pm line 112.

[Wed May  9 02:15:48 2018] [debug] Template "exception.development.html.ep" not found
[Wed May  9 02:15:48 2018] [debug] Template "exception.html.ep" not found
[Wed May  9 02:15:48 2018] [debug] Rendering template "mojo/debug.html.ep"
[Wed May  9 02:15:48 2018] [debug] Rendering template "mojo/menubar.html.ep"
[Wed May  9 02:15:48 2018] [debug] Your secret passphrase needs to be changed
[Wed May  9 02:15:48 2018] [debug] 500 Internal Server Error (0.028515s, 35.069/s)
[Wed May  9 02:15:49 2018] [debug] GET "/"
[Wed May  9 02:15:49 2018] [debug] Routing to a callback
[Wed May  9 02:15:49 2018] [debug] 200 OK (0.01038s, 96.339/s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant