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

crumb request.plugins.crumb: undefined #51

Closed
abernardobr opened this issue Jun 4, 2015 · 4 comments · Fixed by #63
Closed

crumb request.plugins.crumb: undefined #51

abernardobr opened this issue Jun 4, 2015 · 4 comments · Fixed by #63
Assignees
Labels
bug
Milestone

Comments

@abernardobr
Copy link

@abernardobr abernardobr commented Jun 4, 2015

Versions: HAPI: 8.5.2, crumb: 4.0.3, hapi-auth-cookie: 2.2.0
Startup process:

crumbOpts = {
            key: 'encrumb',
            restful: true,
            allowOrigins: ['http://*.emprego.net', 'https://*.emprego.net'],
            cookieOptions: {
                ttl: 356 * 60 * 60 * 1000,
                isSecure: false
            }
        };

authOpts = {
            password: 'anynicepassword',
            cookie: 'sid-myappname',
            redirectTo: '/unlogged',
            isSecure: false,
            keepAlive: true,
            ttl: 356 * 60 * 60 * 1000
        };

I am staring up first Crumb and then Cookie.

On my machine (Mac OSx Yosemite) I start the server with pm2 with several CPUs. It all works fine.

On the production server I start the server with pm2 with several CPUs. It all works fine with Chrome and IE. Once I use Firefox it is giving me the following problem:

It is generating the crumb just fine.

ui-0 (out): crumb generate --> crumb: xn27IZhk_WxKw0xSFVdWH2wbuWVoawsKWYWm0hPxM7Z
ui-0 (out): crumb onPreResponse --> request.plugins.crumb: xn27IZhk_WxKw0xSFVdWH2wbuWVoawsKWYWm0hPxM7Z
ui-0 (out): crumb onPostAuth
ui-0 (out): crumb onPostAuth 1 - request.route.settings.plugins._crumb: [object Object]
ui-0 (out): crumb onPostAuth settings.autoGenerate: true request.route.settings.plugins._crumb: [object Object]
ui-0 (out): crumb onPreResponse --> settings.addToViewContext: true - request.route.settings.plugins._crumb: [object Object] - request.plugins.crumb: undefined - response.variety: view

But once I make a POST request:

ui-0 (out): crumb onPostAuth
ui-0 (out): crumb onPostAuth settings.autoGenerate: true request.route.settings.plugins._crumb: [object Object]
ui-0 (out): crunb onPostAuth --> header: xn27IZhk_WxKw0xSFVdWH2wbuWVoawsKWYWm0hPxM7Z
ui-0 (out): 'xn27IZhk_WxKw0xSFVdWH2wbuWVoawsKWYWm0hPxM7Z'
ui-0 (out): crunb onPostAuth --> request.plugins.crumb: undefined
ui-0 (out): crumb onPreResponse --> settings.addToViewContext: true - request.route.settings.plugins._crumb: [object Object] - request.plugins.crumb: undefined - response.variety: undefined

Notice that request.plugins.crumb: undefined
is undefined

I have tried all sorts of ways to detect why this might be happening, but have not yet come to any light on how to possibly solve this problem.

@stongo stongo added the bug label Jun 5, 2015
@stongo stongo self-assigned this Jun 5, 2015
@stongo

This comment has been minimized.

Copy link
Contributor

@stongo stongo commented Jun 5, 2015

To clarify, this only happens on this particular POST route? Or for all POSTs?

@abernardobr

This comment has been minimized.

Copy link
Author

@abernardobr abernardobr commented Jun 5, 2015

Hello @stongo. Thanks for your reply.

This happens on a login POST.

Since I cannot get it, I cannot test the other routes.

@stongo stongo added this to the 4.04 milestone Jun 5, 2015
@stongo

This comment has been minimized.

Copy link
Contributor

@stongo stongo commented Jun 12, 2015

This might nothing, but might you have a typo somewhere?

ui-0 (out): crunb onPostAuth --> request.plugins.crumb: undefined

@stongo

This comment has been minimized.

Copy link
Contributor

@stongo stongo commented Oct 22, 2015

Getting a similar error in one test only when converting crumb to hapi 9 f728d64. This may be related to this issue

@stongo stongo modified the milestones: 5.0.0, 4.04 Oct 22, 2015
stongo added a commit that referenced this issue Oct 26, 2015
@stongo stongo mentioned this issue Oct 26, 2015
@stongo stongo closed this in #63 Oct 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.