Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with password based on the example in this group and in the projects' Readme, i've created a new derby project from command line and i wrote in lib/server/index.js this: https://gist.github.com/3749520
When i run, i've:
starting step - displayLogin Error: Cannot find module 'undefined' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:362:17) at require (module.js:378:17) at new View (/home/andrea/projects/first-project/node_modules/express/lib/view.js:42:49 ) at Function.app.render (/home/andrea/projects/first-project/node_modules/express/lib/application.j s:486:12) at render (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 63:9) at ServerResponse.res.render (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 87:5) at render (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:48:13) at Object.render [as _displayLogin] (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:56:16) ...finished step
It seems a rendering error. Could someone give me some suggestions about this error?
> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with > password based on the example in this group and in the projects' Readme, > i've created a new derby project from command line and i wrote in > lib/server/index.js this:
> https://gist.github.com/3749520
> When i run, i've:
> starting step - displayLogin
> Error: Cannot find module 'undefined'
> at Function.Module._resolveFilename (module.js:338:15)
> at Function.Module._load (module.js:280:25)
> at Module.require (module.js:362:17)
> at require (module.js:378:17)
> at new View > (/home/andrea/projects/first-project/node_modules/express/lib/view.js:42:49 )
> at Function.app.render > (/home/andrea/projects/first-project/node_modules/express/lib/application.j s:486:12)
> at render > (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 63:9)
> at ServerResponse.res.render > (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 87:5)
> at render > (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:48:13)
> at Object.render [as _displayLogin] > (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:56:16)
> ...finished step
> It seems a rendering error. Could someone give me some suggestions about > this error?
On Thursday, September 20, 2012 12:20:52 PM UTC+2, Владимир Махаев wrote:
> I`ve got this error too. No suggestions.
> среда, 19 сентября 2012 г., 17:04:48 UTC+4 пользователь Andrea Di Mario > написал:
>> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with >> password based on the example in this group and in the projects' Readme, >> i've created a new derby project from command line and i wrote in >> lib/server/index.js this:
>> https://gist.github.com/3749520
>> When i run, i've:
>> starting step - displayLogin
>> Error: Cannot find module 'undefined'
>> at Function.Module._resolveFilename (module.js:338:15)
>> at Function.Module._load (module.js:280:25)
>> at Module.require (module.js:362:17)
>> at require (module.js:378:17)
>> at new View >> (/home/andrea/projects/first-project/node_modules/express/lib/view.js:42:49 )
>> at Function.app.render >> (/home/andrea/projects/first-project/node_modules/express/lib/application.j s:486:12)
>> at render >> (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 63:9)
>> at ServerResponse.res.render >> (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 87:5)
>> at render >> (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:48:13)
>> at Object.render [as _displayLogin] >> (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:56:16)
>> ...finished step
>> It seems a rendering error. Could someone give me some suggestions about >> this error?
Yeah sorry, habit only has FB currently - other services (twitter, GH) to
come, but password looked daunting to me. When I tackle an everyauth fork
of chat/todoMVC, i'll be sure to include password.
On Thu, Sep 20, 2012 at 12:49 PM, Andrea Di Mario <anddima...@gmail.com>wrote:
> Hi, maybe a bug, unfortunally the examples in the other post use only
> facebook auth. We should wait for an example app or some more docs.
> Regards
> On Thursday, September 20, 2012 12:20:52 PM UTC+2, Владимир Махаев wrote:
>> I`ve got this error too. No suggestions.
>> среда, 19 сентября 2012 г., 17:04:48 UTC+4 пользователь Andrea Di Mario
>> написал:
>>> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with
>>> password based on the example in this group and in the projects' Readme,
>>> i've created a new derby project from command line and i wrote in
>>> lib/server/index.js this:
>>> https://gist.github.com/**3749520 <https://gist.github.com/3749520>
>>> When i run, i've:
>>> starting step - displayLogin
>>> Error: Cannot find module 'undefined'
>>> at Function.Module._**resolveFilename (module.js:338:15)
>>> at Function.Module._load (module.js:280:25)
>>> at Module.require (module.js:362:17)
>>> at require (module.js:378:17)
>>> at new View (/home/andrea/projects/first-**
>>> project/node_modules/express/**lib/view.js:42:49)
>>> at Function.app.render (/home/andrea/projects/first-**
>>> project/node_modules/express/**lib/application.js:486:12)
>>> at render (/home/andrea/projects/first-**
>>> project/node_modules/express/**lib/response.js:663:9)
>>> at ServerResponse.res.render (/home/andrea/projects/first-**
>>> project/node_modules/express/**lib/response.js:687:5)
>>> at render (/home/andrea/projects/first-**project/node_modules/**
>>> everyauth/lib/modules/**password.js:48:13)
>>> at Object.render [as _displayLogin] (/home/andrea/projects/first-**
>>> project/node_modules/**everyauth/lib/modules/**password.js:56:16)
>>> ...finished step
>>> It seems a rendering error. Could someone give me some suggestions about
>>> this error?
On Thursday, September 20, 2012 6:57:05 PM UTC+2, Tyler Renelle wrote:
> Yeah sorry, habit only has FB currently - other services (twitter, GH) to > come, but password looked daunting to me. When I tackle an everyauth fork > of chat/todoMVC, i'll be sure to include password.
> On Thu, Sep 20, 2012 at 12:49 PM, Andrea Di Mario <anddi...@gmail.com<javascript:>
> > wrote:
>> Hi, maybe a bug, unfortunally the examples in the other post use only >> facebook auth. We should wait for an example app or some more docs.
>> Regards
>> On Thursday, September 20, 2012 12:20:52 PM UTC+2, Владимир Махаев wrote:
>>> I`ve got this error too. No suggestions.
>>> среда, 19 сентября 2012 г., 17:04:48 UTC+4 пользователь Andrea Di Mario >>> написал:
>>>> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with >>>> password based on the example in this group and in the projects' Readme, >>>> i've created a new derby project from command line and i wrote in >>>> lib/server/index.js this:
>>>> https://gist.github.com/**3749520 <https://gist.github.com/3749520>
>>>> When i run, i've:
>>>> starting step - displayLogin
>>>> Error: Cannot find module 'undefined'
>>>> at Function.Module._**resolveFilename (module.js:338:15)
>>>> at Function.Module._load (module.js:280:25)
>>>> at Module.require (module.js:362:17)
>>>> at require (module.js:378:17)
>>>> at new View (/home/andrea/projects/first-**
>>>> project/node_modules/express/**lib/view.js:42:49)
>>>> at Function.app.render (/home/andrea/projects/first-**
>>>> project/node_modules/express/**lib/application.js:486:12)
>>>> at render (/home/andrea/projects/first-**
>>>> project/node_modules/express/**lib/response.js:663:9)
>>>> at ServerResponse.res.render (/home/andrea/projects/first-**
>>>> project/node_modules/express/**lib/response.js:687:5)
>>>> at render (/home/andrea/projects/first-**project/node_modules/**
>>>> everyauth/lib/modules/**password.js:48:13)
>>>> at Object.render [as _displayLogin] (/home/andrea/projects/first-**
>>>> project/node_modules/**everyauth/lib/modules/**password.js:56:16)
>>>> ...finished step
>>>> It seems a rendering error. Could someone give me some suggestions >>>> about this error?
On Thursday, 20 September 2012 12:57:05 UTC-4, Tyler Renelle wrote:
> Yeah sorry, habit only has FB currently - other services (twitter, GH) to > come, but password looked daunting to me. When I tackle an everyauth fork > of chat/todoMVC, i'll be sure to include password.
> On Thu, Sep 20, 2012 at 12:49 PM, Andrea Di Mario <anddima...@gmail.com>wrote:
>> Hi, maybe a bug, unfortunally the examples in the other post use only >> facebook auth. We should wait for an example app or some more docs.
>> Regards
>> On Thursday, September 20, 2012 12:20:52 PM UTC+2, Владимир Махаев wrote:
>>> I`ve got this error too. No suggestions.
>>> среда, 19 сентября 2012 г., 17:04:48 UTC+4 пользователь Andrea Di Mario >>> написал:
>>>> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with >>>> password based on the example in this group and in the projects' Readme, >>>> i've created a new derby project from command line and i wrote in >>>> lib/server/index.js this:
>>>> https://gist.github.com/**3749520 <https://gist.github.com/3749520>
>>>> When i run, i've:
>>>> starting step - displayLogin
>>>> Error: Cannot find module 'undefined'
>>>> at Function.Module._**resolveFilename (module.js:338:15)
>>>> at Function.Module._load (module.js:280:25)
>>>> at Module.require (module.js:362:17)
>>>> at require (module.js:378:17)
>>>> at new View (/home/andrea/projects/first-**
>>>> project/node_modules/express/**lib/view.js:42:49)
>>>> at Function.app.render (/home/andrea/projects/first-**
>>>> project/node_modules/express/**lib/application.js:486:12)
>>>> at render (/home/andrea/projects/first-**
>>>> project/node_modules/express/**lib/response.js:663:9)
>>>> at ServerResponse.res.render (/home/andrea/projects/first-**
>>>> project/node_modules/express/**lib/response.js:687:5)
>>>> at render (/home/andrea/projects/first-**project/node_modules/**
>>>> everyauth/lib/modules/**password.js:48:13)
>>>> at Object.render [as _displayLogin] (/home/andrea/projects/first-**
>>>> project/node_modules/**everyauth/lib/modules/**password.js:56:16)
>>>> ...finished step
>>>> It seems a rendering error. Could someone give me some suggestions >>>> about this error?
> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with > password based on the example in this group and in the projects' Readme, > i've created a new derby project from command line and i wrote in > lib/server/index.js this:
> https://gist.github.com/3749520
> When i run, i've:
> starting step - displayLogin
> Error: Cannot find module 'undefined'
> at Function.Module._resolveFilename (module.js:338:15)
> at Function.Module._load (module.js:280:25)
> at Module.require (module.js:362:17)
> at require (module.js:378:17)
> at new View > (/home/andrea/projects/first-project/node_modules/express/lib/view.js:42:49 )
> at Function.app.render > (/home/andrea/projects/first-project/node_modules/express/lib/application.j s:486:12)
> at render > (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 63:9)
> at ServerResponse.res.render > (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 87:5)
> at render > (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:48:13)
> at Object.render [as _displayLogin] > (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:56:16)
> ...finished step
> It seems a rendering error. Could someone give me some suggestions about > this error?
Well he did say it would be a few weeks at least... I'd appreciate an update on this too though... I have been checking back here every day in anticipation :)
I've got some awesome ideas of what I want to make with Derby but without password authentication it just can't work and security isn't really something I'd attempt myself without fully understanding how everything works inside out, which I don't. Very tempted to start with certain other frameworks out there that have auth examples already, but I can resist a little longer.... just...a...bit...more...patience...must... resist :D
On Wednesday, October 10, 2012 1:22:34 PM UTC+1, Владимир Махаев wrote:
> Still no solution?
> среда, 19 сентября 2012 г., 17:04:48 UTC+4 пользователь Andrea Di Mario > написал:
>> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with >> password based on the example in this group and in the projects' Readme, >> i've created a new derby project from command line and i wrote in >> lib/server/index.js this:
>> https://gist.github.com/3749520
>> When i run, i've:
>> starting step - displayLogin
>> Error: Cannot find module 'undefined'
>> at Function.Module._resolveFilename (module.js:338:15)
>> at Function.Module._load (module.js:280:25)
>> at Module.require (module.js:362:17)
>> at require (module.js:378:17)
>> at new View >> (/home/andrea/projects/first-project/node_modules/express/lib/view.js:42:49 )
>> at Function.app.render >> (/home/andrea/projects/first-project/node_modules/express/lib/application.j s:486:12)
>> at render >> (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 63:9)
>> at ServerResponse.res.render >> (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 87:5)
>> at render >> (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:48:13)
>> at Object.render [as _displayLogin] >> (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:56:16)
>> ...finished step
>> It seems a rendering error. Could someone give me some suggestions about >> this error?
On Thursday, 11 October 2012 06:10:13 UTC-4, Darryl Ryan wrote:
> Well he did say it would be a few weeks at least... I'd appreciate an > update on this too though... I have been checking back here every day in > anticipation :)
> I've got some awesome ideas of what I want to make with Derby but without > password authentication it just can't work and security isn't really > something I'd attempt myself without fully understanding how everything > works inside out, which I don't. Very tempted to start with certain other > frameworks out there that have auth examples already, but I can resist a > little longer.... just...a...bit...more...patience...must... resist :D
> On Wednesday, October 10, 2012 1:22:34 PM UTC+1, Владимир Махаев wrote:
>> Still no solution?
>> среда, 19 сентября 2012 г., 17:04:48 UTC+4 пользователь Andrea Di Mario >> написал:
>>> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with >>> password based on the example in this group and in the projects' Readme, >>> i've created a new derby project from command line and i wrote in >>> lib/server/index.js this:
>>> https://gist.github.com/3749520
>>> When i run, i've:
>>> starting step - displayLogin
>>> Error: Cannot find module 'undefined'
>>> at Function.Module._resolveFilename (module.js:338:15)
>>> at Function.Module._load (module.js:280:25)
>>> at Module.require (module.js:362:17)
>>> at require (module.js:378:17)
>>> at new View >>> (/home/andrea/projects/first-project/node_modules/express/lib/view.js:42:49 )
>>> at Function.app.render >>> (/home/andrea/projects/first-project/node_modules/express/lib/application.j s:486:12)
>>> at render >>> (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 63:9)
>>> at ServerResponse.res.render >>> (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 87:5)
>>> at render >>> (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:48:13)
>>> at Object.render [as _displayLogin] >>> (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:56:16)
>>> ...finished step
>>> It seems a rendering error. Could someone give me some suggestions about >>> this error?
I dived a bit into the code and I'm not exactly sure what's going on. I know if I pass in: login /views/app/login
I get the same exception. If I pass in login.html /views/app/login.html
The exception changes somewhat to:
Error: Cannot find module 'html'
My guess: Whatever derby is using to register templates doesn't use the file extension. However, this code expects the file extension to point to the view engine (like jade, as the example uses).
I found this comment in the source of password.js in EveryAuth for the loginView property.
This is what goes in loginView:
Either (A) the name of the view (e.g., "login.jade") or (B) the HTML string corresponds to the login page or (C) a function (errors, login) {...} that returns the HTML string incorporating the array of `errors` messages and the `login` used in the prior attempt'
Andrea, it sounds like we've both tried A, but because of the syntax for the derby views, that doesn't work. I've been searching through the derby source trying to find an easy way to render a view to a string so that I could pass that to this method, but haven't figured it out yet.
Everyauth uses express.js rendering (not derby).
Express.js needs engine for every file extension it renders. If there is no, it tries to find one with simply doing: engine = require(file extension)
That`s why we see error message.
So all we need is to add some engine to express.js or just do like this:
Now for login.html in views folder (express.js uses /views/ folder by default):
.loginView('login.html')
That`s works but it`s half way solution, because in ideal we want derby.js to render everything.
There is a static rendering in derby.js, you can find it in app/server/serverError.js but to connect it to everyauth it`s needed to change everyauth or derby`s static rendering. I`m not sure how to do it best. Hope that derby team will consider this.
пятница, 12 октября 2012 г., 12:30:26 UTC+4 пользователь Matt написал:
> I've been playing with password auth lately (I haven't gotten much farther > than you), but I've figured out the line of code that is causing the error.
> I dived a bit into the code and I'm not exactly sure what's going on. I know if I pass in:
> login
> /views/app/login
> I get the same exception. If I pass in
> login.html
> /views/app/login.html
> The exception changes somewhat to:
> Error: Cannot find module 'html'
> My guess: Whatever derby is using to register templates doesn't use the file extension. However, this code expects the file extension to point to the view engine (like jade, as the example uses).
> I found this comment in the source of password.js in EveryAuth for the loginView property.
> This is what goes in loginView:
> Either (A) the name of the view (e.g., "login.jade") > or (B) the HTML string corresponds to the login page > or (C) a function (errors, login) {...} that returns the HTML string incorporating the array of `errors` messages and the `login` used in the prior attempt'
> Andrea, it sounds like we've both tried A, but because of the syntax for > the derby views, that doesn't work. I've been searching through the derby > source trying to find an easy way to render a view to a string so that I > could pass that to this method, but haven't figured it out yet.
On Fri, Oct 26, 2012 at 4:10 PM, Владимир Махаев <vmakh...@gmail.com> wrote:
> After digging a little found something.
> Everyauth uses express.js rendering (not derby).
> Express.js needs engine for every file extension it renders. If there is
> no, it tries to find one with simply doing:
> engine = require(file extension)
> That`s why we see error message.
> So all we need is to add some engine to express.js or just do like this:
> Now for login.html in views folder (express.js uses /views/ folder by
> default):
> .loginView('login.html')
> That`s works but it`s half way solution, because in ideal we want derby.js
> to render everything.
> There is a static rendering in derby.js, you can find it in
> app/server/serverError.js but to connect it to everyauth it`s needed to
> change everyauth or derby`s static rendering. I`m not sure how to do it
> best. Hope that derby team will consider this.
> пятница, 12 октября 2012 г., 12:30:26 UTC+4 пользователь Matt написал:
>> Andrea,
>> I've been playing with password auth lately (I haven't gotten much
>> farther than you), but I've figured out the line of code that is causing
>> the error.
>> I dived a bit into the code and I'm not exactly sure what's going on. I know if I pass in:
>> login
>> /views/app/login
>> I get the same exception. If I pass in
>> login.html
>> /views/app/login.html
>> The exception changes somewhat to:
>> Error: Cannot find module 'html'
>> My guess: Whatever derby is using to register templates doesn't use the file extension. However, this code expects the file extension to point to the view engine (like jade, as the example uses).
>> I found this comment in the source of password.js in EveryAuth for the loginView property.
>> This is what goes in loginView:
>> Either (A) the name of the view (e.g., "login.jade")
>> or (B) the HTML string corresponds to the login page
>> or (C) a function (errors, login) {...} that returns the HTML string incorporating the array of `errors` messages and the `login` used in the prior attempt'
>> Andrea, it sounds like we've both tried A, but because of the syntax for
>> the derby views, that doesn't work. I've been searching through the derby
>> source trying to find an easy way to render a view to a string so that I
>> could pass that to this method, but haven't figured it out yet.
> I haven't checked but isn't it possible to drop the extension and have the > everyauth login page on another endpoint, maybe just /login?
> On Fri, Oct 26, 2012 at 4:10 PM, Владимир Махаев <vmak...@gmail.com<javascript:>
> > wrote:
>> After digging a little found something.
>> Everyauth uses express.js rendering (not derby).
>> Express.js needs engine for every file extension it renders. If there is >> no, it tries to find one with simply doing: >> engine = require(file extension)
>> That`s why we see error message.
>> So all we need is to add some engine to express.js or just do like this:
>> Now for login.html in views folder (express.js uses /views/ folder by >> default):
>> .loginView('login.html')
>> That`s works but it`s half way solution, because in ideal we want >> derby.js to render everything.
>> There is a static rendering in derby.js, you can find it in >> app/server/serverError.js but to connect it to everyauth it`s needed to >> change everyauth or derby`s static rendering. I`m not sure how to do it >> best. Hope that derby team will consider this.
>> пятница, 12 октября 2012 г., 12:30:26 UTC+4 пользователь Matt написал:
>>> Andrea,
>>> I've been playing with password auth lately (I haven't gotten much >>> farther than you), but I've figured out the line of code that is causing >>> the error.
>>> I dived a bit into the code and I'm not exactly sure what's going on. I know if I pass in:
>>> login
>>> /views/app/login
>>> I get the same exception. If I pass in
>>> login.html
>>> /views/app/login.html
>>> The exception changes somewhat to:
>>> Error: Cannot find module 'html'
>>> My guess: Whatever derby is using to register templates doesn't use the file extension. However, this code expects the file extension to point to the view engine (like jade, as the example uses).
>>> I found this comment in the source of password.js in EveryAuth for the loginView property.
>>> This is what goes in loginView:
>>> Either (A) the name of the view (e.g., "login.jade") >>> or (B) the HTML string corresponds to the login page
>>> or (C) a function (errors, login) {...} that returns the HTML string incorporating the array of `errors` messages and the `login` used in the prior attempt'
>>> Andrea, it sounds like we've both tried A, but because of the syntax for >>> the derby views, that doesn't work. I've been searching through the derby >>> source trying to find an easy way to render a view to a string so that I >>> could pass that to this method, but haven't figured it out yet.
On Fri, Oct 26, 2012 at 4:46 PM, Владимир Махаев <vmakh...@gmail.com> wrote:
> It would be possible to pass undefined like an extension to
> expressApp.engine function if it does not check for dot in extension.
> So not possible.
> пятница, 26 октября 2012 г., 18:35:36 UTC+4 пользователь Laszlo Bacsi
> написал:
>> I haven't checked but isn't it possible to drop the extension and have
>> the everyauth login page on another endpoint, maybe just /login?
>> On Fri, Oct 26, 2012 at 4:10 PM, Владимир Махаев <vmak...@gmail.com>wrote:
>>> After digging a little found something.
>>> Everyauth uses express.js rendering (not derby).
>>> Express.js needs engine for every file extension it renders. If there is
>>> no, it tries to find one with simply doing:
>>> engine = require(file extension)
>>> That`s why we see error message.
>>> So all we need is to add some engine to express.js or just do like this:
>>> Now for login.html in views folder (express.js uses /views/ folder by
>>> default):
>>> .loginView('login.html')
>>> That`s works but it`s half way solution, because in ideal we want
>>> derby.js to render everything.
>>> There is a static rendering in derby.js, you can find it in
>>> app/server/serverError.js but to connect it to everyauth it`s needed to
>>> change everyauth or derby`s static rendering. I`m not sure how to do it
>>> best. Hope that derby team will consider this.
>>> пятница, 12 октября 2012 г., 12:30:26 UTC+4 пользователь Matt написал:
>>>> Andrea,
>>>> I've been playing with password auth lately (I haven't gotten much
>>>> farther than you), but I've figured out the line of code that is causing
>>>> the error.
>>>> I dived a bit into the code and I'm not exactly sure what's going on. I know if I pass in:
>>>> login
>>>> /views/app/login
>>>> I get the same exception. If I pass in
>>>> login.html
>>>> /views/app/login.html
>>>> The exception changes somewhat to:
>>>> Error: Cannot find module 'html'
>>>> My guess: Whatever derby is using to register templates doesn't use the file extension. However, this code expects the file extension to point to the view engine (like jade, as the example uses).
>>>> I found this comment in the source of password.js in EveryAuth for the loginView property.
>>>> This is what goes in loginView:
>>>> Either (A) the name of the view (e.g., "login.jade")
>>>> or (B) the HTML string corresponds to the login page
>>>> or (C) a function (errors, login) {...} that returns the HTML string incorporating the array of `errors` messages and the `login` used in the prior attempt'
>>>> Andrea, it sounds like we've both tried A, but because of the syntax
>>>> for the derby views, that doesn't work. I've been searching through the
>>>> derby source trying to find an easy way to render a view to a string so
>>>> that I could pass that to this method, but haven't figured it out yet.
> I meant if it's possible to configure everyauth so that it uses /login as > the login page and not /login.html.
> On Fri, Oct 26, 2012 at 4:46 PM, Владимир Махаев <vmak...@gmail.com<javascript:>
> > wrote:
>> It would be possible to pass undefined like an extension to >> expressApp.engine function if it does not check for dot in extension.
>> So not possible.
>> пятница, 26 октября 2012 г., 18:35:36 UTC+4 пользователь Laszlo Bacsi >> написал:
>>> I haven't checked but isn't it possible to drop the extension and have >>> the everyauth login page on another endpoint, maybe just /login?
>>> On Fri, Oct 26, 2012 at 4:10 PM, Владимир Махаев <vmak...@gmail.com>wrote:
>>>> After digging a little found something.
>>>> Everyauth uses express.js rendering (not derby).
>>>> Express.js needs engine for every file extension it renders. If there >>>> is no, it tries to find one with simply doing: >>>> engine = require(file extension)
>>>> That`s why we see error message.
>>>> So all we need is to add some engine to express.js or just do like this:
>>>> Now for login.html in views folder (express.js uses /views/ folder by >>>> default):
>>>> .loginView('login.html')
>>>> That`s works but it`s half way solution, because in ideal we want >>>> derby.js to render everything.
>>>> There is a static rendering in derby.js, you can find it in >>>> app/server/serverError.js but to connect it to everyauth it`s needed to >>>> change everyauth or derby`s static rendering. I`m not sure how to do it >>>> best. Hope that derby team will consider this.
>>>> пятница, 12 октября 2012 г., 12:30:26 UTC+4 пользователь Matt написал:
>>>>> Andrea,
>>>>> I've been playing with password auth lately (I haven't gotten much >>>>> farther than you), but I've figured out the line of code that is causing >>>>> the error.
>>>>> I dived a bit into the code and I'm not exactly sure what's going on. I know if I pass in:
>>>>> login
>>>>> /views/app/login
>>>>> I get the same exception. If I pass in
>>>>> login.html
>>>>> /views/app/login.html
>>>>> The exception changes somewhat to:
>>>>> Error: Cannot find module 'html'
>>>>> My guess: Whatever derby is using to register templates doesn't use the file extension. However, this code expects the file extension to point to the view engine (like jade, as the example uses).
>>>>> I found this comment in the source of password.js in EveryAuth for the loginView property.
>>>>> This is what goes in loginView:
>>>>> Either (A) the name of the view (e.g., "login.jade") >>>>> or (B) the HTML string corresponds to the login page
>>>>> or (C) a function (errors, login) {...} that returns the HTML string incorporating the array of `errors` messages and the `login` used in the prior attempt'
>>>>> Andrea, it sounds like we've both tried A, but because of the syntax >>>>> for the derby views, that doesn't work. I've been searching through the >>>>> derby source trying to find an easy way to render a view to a string so >>>>> that I could pass that to this method, but haven't figured it out yet.
On Friday, October 26, 2012 5:22:33 PM UTC+2, Владимир Махаев wrote:
> I see no way.
> пятница, 26 октября 2012 г., 19:00:09 UTC+4 пользователь Laszlo Bacsi > написал:
>> I meant if it's possible to configure everyauth so that it uses /login as >> the login page and not /login.html.
>> On Fri, Oct 26, 2012 at 4:46 PM, Владимир Махаев <vmak...@gmail.com>wrote:
>>> It would be possible to pass undefined like an extension to >>> expressApp.engine function if it does not check for dot in extension.
>>> So not possible.
>>> пятница, 26 октября 2012 г., 18:35:36 UTC+4 пользователь Laszlo Bacsi >>> написал:
>>>> I haven't checked but isn't it possible to drop the extension and have >>>> the everyauth login page on another endpoint, maybe just /login?
>>>> On Fri, Oct 26, 2012 at 4:10 PM, Владимир Махаев <vmak...@gmail.com>wrote:
>>>>> After digging a little found something.
>>>>> Everyauth uses express.js rendering (not derby).
>>>>> Express.js needs engine for every file extension it renders. If there >>>>> is no, it tries to find one with simply doing: >>>>> engine = require(file extension)
>>>>> That`s why we see error message.
>>>>> So all we need is to add some engine to express.js or just do like >>>>> this:
>>>>> Now for login.html in views folder (express.js uses /views/ folder by >>>>> default):
>>>>> .loginView('login.html')
>>>>> That`s works but it`s half way solution, because in ideal we want >>>>> derby.js to render everything.
>>>>> There is a static rendering in derby.js, you can find it in >>>>> app/server/serverError.js but to connect it to everyauth it`s needed to >>>>> change everyauth or derby`s static rendering. I`m not sure how to do it >>>>> best. Hope that derby team will consider this.
>>>>> пятница, 12 октября 2012 г., 12:30:26 UTC+4 пользователь Matt написал:
>>>>>> Andrea,
>>>>>> I've been playing with password auth lately (I haven't gotten much >>>>>> farther than you), but I've figured out the line of code that is causing >>>>>> the error.
>>>>>> I dived a bit into the code and I'm not exactly sure what's going on. I know if I pass in:
>>>>>> login
>>>>>> /views/app/login
>>>>>> I get the same exception. If I pass in
>>>>>> login.html
>>>>>> /views/app/login.html
>>>>>> The exception changes somewhat to:
>>>>>> Error: Cannot find module 'html'
>>>>>> My guess: Whatever derby is using to register templates doesn't use the file extension. However, this code expects the file extension to point to the view engine (like jade, as the example uses).
>>>>>> I found this comment in the source of password.js in EveryAuth for the loginView property.
>>>>>> This is what goes in loginView:
>>>>>> Either (A) the name of the view (e.g., "login.jade") >>>>>> or (B) the HTML string corresponds to the login page
>>>>>> or (C) a function (errors, login) {...} that returns the HTML string incorporating the array of `errors` messages and the `login` used in the prior attempt'
>>>>>> Andrea, it sounds like we've both tried A, but because of the syntax >>>>>> for the derby views, that doesn't work. I've been searching through the >>>>>> derby source trying to find an easy way to render a view to a string so >>>>>> that I could pass that to this method, but haven't figured it out yet.
Matt & (Vladimir?) are right, Everyauth's "password" module handles view rendering (via res.render) directly, and so expects to be tied to a view engine (jade) and view files. Integration with Derby's mustache-offshoot templating system will have be built either as an express-compatible view engine (since even static routes use Derby's engine), or as an exception in Everyauth's password.js<https://github.com/bnoguchi/everyauth/blob/master/lib/modules/passwor...> file. I think the latter is the best method, maybe password.js can expose a configurable - like *dontRender* - which would bypass all rendering code and leave passing variables to views to our own devices (which we'd do via model.set("_errors", errors), for example).
I came across this trying to implement a working example of password login in my authentication example<https://github.com/lefnire/derby-examples/tree/master/authentication>. My thoughts then were: Ok, then let's not use password module as Everyauth middleware, but instead let's create our own custom middleware that calls functions from password module just to reuse some logic. However, all the methods are chained promises, so I don't think they're accessible to be called directly.
So as it stands, even with Vladimir's html-engine hack, I don't think everyauth/password and derby are compatible. So here are next step options
- Create pull request for Brian a la previous mentioned modifications (* dontRender* configurable, or something) - Handle user registration and login with custom code, not Everyauth. It shouldn't be too difficult, I'm not sure that everyauth adds too much in the way of password login (I use Everyauth for its social-network api integration) - Or use Passport <http://passportjs.org/>
On Wednesday, 19 September 2012 09:04:48 UTC-4, Andrea Di Mario wrote:
> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with > password based on the example in this group and in the projects' Readme, > i've created a new derby project from command line and i wrote in > lib/server/index.js this: > https://gist.github.com/3749520
> When i run, i've:
> starting step - displayLogin > Error: Cannot find module 'undefined' > at Function.Module._resolveFilename (module.js:338:15) > at Function.Module._load (module.js:280:25) > at Module.require (module.js:362:17) > at require (module.js:378:17) > at new View > (/home/andrea/projects/first-project/node_modules/express/lib/view.js:42:49 ) > at Function.app.render > (/home/andrea/projects/first-project/node_modules/express/lib/application.j s:486:12) > at render > (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 63:9) > at ServerResponse.res.render > (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 87:5) > at render > (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:48:13) > at Object.render [as _displayLogin] > (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:56:16) > ...finished step
> It seems a rendering error. Could someone give me some suggestions about > this error?
Keep an eye on my auth example<https://github.com/lefnire/derby-examples/tree/master/authentication>. I'm trying to separate code out into a node module "derby-auth". Having a lot of trouble with password authentication, so please fork if you have any insights. My plans are to play around with providing my own everyauth.submodule called derbyPassword (in ./lib) which re-uses a bunch of password.js code, but makes it compatible with Derby. If this proves too difficult, I'm going to replace Everyauth with Passport.
On Monday, 5 November 2012 16:38:45 UTC-5, Tyler Renelle wrote:
> Matt & (Vladimir?) are right, Everyauth's "password" module handles view > rendering (via res.render) directly, and so expects to be tied to a view > engine (jade) and view files. Integration with Derby's mustache-offshoot > templating system will have be built either as an express-compatible view > engine (since even static routes use Derby's engine), or as an exception in > Everyauth's password.js<https://github.com/bnoguchi/everyauth/blob/master/lib/modules/passwor...> file. > I think the latter is the best method, maybe password.js can expose a > configurable - like *dontRender* - which would bypass all rendering code > and leave passing variables to views to our own devices (which we'd do via > model.set("_errors", errors), for example).
> I came across this trying to implement a working example of password login > in my authentication example<https://github.com/lefnire/derby-examples/tree/master/authentication>. > My thoughts then were: Ok, then let's not use password module as Everyauth > middleware, but instead let's create our own custom middleware that calls > functions from password module just to reuse some logic. However, all the > methods are chained promises, so I don't think they're accessible to be > called directly.
> So as it stands, even with Vladimir's html-engine hack, I don't think > everyauth/password and derby are compatible. So here are next step options
> - Create pull request for Brian a la previous mentioned modifications ( > *dontRender* configurable, or something) > - Handle user registration and login with custom code, not Everyauth. > It shouldn't be too difficult, I'm not sure that everyauth adds too much in > the way of password login (I use Everyauth for its social-network api > integration) > - Or use Passport <http://passportjs.org/>
> On Wednesday, 19 September 2012 09:04:48 UTC-4, Andrea Di Mario wrote:
>> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with >> password based on the example in this group and in the projects' Readme, >> i've created a new derby project from command line and i wrote in >> lib/server/index.js this: >> https://gist.github.com/3749520
>> When i run, i've:
>> starting step - displayLogin >> Error: Cannot find module 'undefined' >> at Function.Module._resolveFilename (module.js:338:15) >> at Function.Module._load (module.js:280:25) >> at Module.require (module.js:362:17) >> at require (module.js:378:17) >> at new View >> (/home/andrea/projects/first-project/node_modules/express/lib/view.js:42:49 ) >> at Function.app.render >> (/home/andrea/projects/first-project/node_modules/express/lib/application.j s:486:12) >> at render >> (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 63:9) >> at ServerResponse.res.render >> (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 87:5) >> at render >> (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:48:13) >> at Object.render [as _displayLogin] >> (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:56:16) >> ...finished step
>> It seems a rendering error. Could someone give me some suggestions about >> this error?
On Wednesday, 19 September 2012 09:04:48 UTC-4, Andrea Di Mario wrote:
> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with > password based on the example in this group and in the projects' Readme, > i've created a new derby project from command line and i wrote in > lib/server/index.js this: > https://gist.github.com/3749520
> When i run, i've:
> starting step - displayLogin > Error: Cannot find module 'undefined' > at Function.Module._resolveFilename (module.js:338:15) > at Function.Module._load (module.js:280:25) > at Module.require (module.js:362:17) > at require (module.js:378:17) > at new View > (/home/andrea/projects/first-project/node_modules/express/lib/view.js:42:49 ) > at Function.app.render > (/home/andrea/projects/first-project/node_modules/express/lib/application.j s:486:12) > at render > (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 63:9) > at ServerResponse.res.render > (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 87:5) > at render > (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:48:13) > at Object.render [as _displayLogin] > (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:56:16) > ...finished step
> It seems a rendering error. Could someone give me some suggestions about > this error?
> On Wednesday, 19 September 2012 09:04:48 UTC-4, Andrea Di Mario wrote:
>> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with >> password based on the example in this group and in the projects' Readme, >> i've created a new derby project from command line and i wrote in >> lib/server/index.js this: >> https://gist.github.com/3749520
>> When i run, i've:
>> starting step - displayLogin >> Error: Cannot find module 'undefined' >> at Function.Module._resolveFilename (module.js:338:15) >> at Function.Module._load (module.js:280:25) >> at Module.require (module.js:362:17) >> at require (module.js:378:17) >> at new View >> (/home/andrea/projects/first-project/node_modules/express/lib/view.js:42:49 ) >> at Function.app.render >> (/home/andrea/projects/first-project/node_modules/express/lib/application.j s:486:12) >> at render >> (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 63:9) >> at ServerResponse.res.render >> (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 87:5) >> at render >> (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:48:13) >> at Object.render [as _displayLogin] >> (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:56:16) >> ...finished step
>> It seems a rendering error. Could someone give me some suggestions about >> this error?
>> On Wednesday, 19 September 2012 09:04:48 UTC-4, Andrea Di Mario wrote:
>>> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with
>>> password based on the example in this group and in the projects' Readme,
>>> i've created a new derby project from command line and i wrote in
>>> lib/server/index.js this:
>>> https://gist.github.com/**3749520 <https://gist.github.com/3749520>
>>> When i run, i've:
>>> starting step - displayLogin
>>> Error: Cannot find module 'undefined'
>>> at Function.Module._**resolveFilename (module.js:338:15)
>>> at Function.Module._load (module.js:280:25)
>>> at Module.require (module.js:362:17)
>>> at require (module.js:378:17)
>>> at new View (/home/andrea/projects/first-**
>>> project/node_modules/express/**lib/view.js:42:49)
>>> at Function.app.render (/home/andrea/projects/first-**
>>> project/node_modules/express/**lib/application.js:486:12)
>>> at render (/home/andrea/projects/first-**
>>> project/node_modules/express/**lib/response.js:663:9)
>>> at ServerResponse.res.render (/home/andrea/projects/first-**
>>> project/node_modules/express/**lib/response.js:687:5)
>>> at render (/home/andrea/projects/first-**project/node_modules/**
>>> everyauth/lib/modules/**password.js:48:13)
>>> at Object.render [as _displayLogin] (/home/andrea/projects/first-**
>>> project/node_modules/**everyauth/lib/modules/**password.js:56:16)
>>> ...finished step
>>> It seems a rendering error. Could someone give me some suggestions about
>>> this error?
On Wednesday, 19 September 2012 09:04:48 UTC-4, Andrea Di Mario wrote:
> Hi, i'm a Derby/Everyauth's new user, i'm trying authentication with > password based on the example in this group and in the projects' Readme, > i've created a new derby project from command line and i wrote in > lib/server/index.js this: > https://gist.github.com/3749520
> When i run, i've:
> starting step - displayLogin > Error: Cannot find module 'undefined' > at Function.Module._resolveFilename (module.js:338:15) > at Function.Module._load (module.js:280:25) > at Module.require (module.js:362:17) > at require (module.js:378:17) > at new View > (/home/andrea/projects/first-project/node_modules/express/lib/view.js:42:49 ) > at Function.app.render > (/home/andrea/projects/first-project/node_modules/express/lib/application.j s:486:12) > at render > (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 63:9) > at ServerResponse.res.render > (/home/andrea/projects/first-project/node_modules/express/lib/response.js:6 87:5) > at render > (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:48:13) > at Object.render [as _displayLogin] > (/home/andrea/projects/first-project/node_modules/everyauth/lib/modules/pas sword.js:56:16) > ...finished step
> It seems a rendering error. Could someone give me some suggestions about > this error?
Hi Tyler! Thanks for your work! I'm approaching Derby for a new project in these days, and without your work it would have been really more painful ;)
Looking around in the source code, I found a typo and JSLint proposed me some coding improvements in index.js. I don't know if you want to consider them: - line #4: "savedStrageties" should be "savedStrategies" ;) - lines #44, #148, #202, #234: add ";" - line #234: remove ";"
Hi, Sorry for my first reply, but after sending it I've noticed that you made quite substantial changes... :/
So: * for derby-auth/index.js: - the "savedStrategies" typo is not there any more since you changed the variable in "_strategies" - some ";" are still missing, but they changed line number: #12, #35, #62, #75, #180, #236 - there's still the unnecessary ";" at line 268 * for example/lib/server/index.js: - again missing some ";", in lines #9, #12, #24, #20 * As for running the example, in the README.md file in the derby-auth/example folder, I would suggest to remember people they have to run "npm install" in both the derby-auth/ and the derby-auth/example directories.
I Apologize if my points are too silly! I hope my eventual next posts will be more "constructive" ;)
On Thursday, November 15, 2012 11:39:41 AM UTC+1, Matteo Brunati wrote:
> Hi Tyler! > Thanks for your work! I'm approaching Derby for a new project in these > days, and without your work it would have been really more painful ;)
> Looking around in the source code, I found a typo and JSLint proposed me > some coding improvements in index.js. I don't know if you want to consider > them: > - line #4: "savedStrageties" should be "savedStrategies" ;) > - lines #44, #148, #202, #234: add ";" > - line #234: remove ";"
These points are absolutely not silly, JSLint suggestions are quite
constructive. However, I would recommend future modifications to be Github
pull requests for these reasons: (1) creates trackable trail, (2) can be
tested (there are not tests now, but later), (3) cuts down on code in
forums. Also, more <https://coderwall.com/dashboard>
and<https://masterbranch.com/>
more <http://geekli.st/> sites <https://workforpie.com/> have begun
tracking coder "clout" by their Github activity, so pull requests will
improve your "online score" :)
On Thu, Nov 15, 2012 at 6:08 AM, Matteo Brunati <mattbru...@gmail.com>wrote:
> Hi,
> Sorry for my first reply, but after sending it I've noticed that you made
> quite substantial changes... :/
> So:
> * for derby-auth/index.js:
> - the "savedStrategies" typo is not there any more since you changed the
> variable in "_strategies"
> - some ";" are still missing, but they changed line number: #12, #35,
> #62, #75, #180, #236
> - there's still the unnecessary ";" at line 268
> * for example/lib/server/index.js:
> - again missing some ";", in lines #9, #12, #24, #20
> * As for running the example, in the README.md file in the
> derby-auth/example folder, I would suggest to remember people they have to
> run "npm install" in both the derby-auth/ and the derby-auth/example
> directories.
> I Apologize if my points are too silly! I hope my eventual next posts will
> be more "constructive" ;)
> Regards,
> Matteo
> On Thursday, November 15, 2012 11:39:41 AM UTC+1, Matteo Brunati wrote:
>> Hi Tyler!
>> Thanks for your work! I'm approaching Derby for a new project in these
>> days, and without your work it would have been really more painful ;)
>> Looking around in the source code, I found a typo and JSLint proposed me
>> some coding improvements in index.js. I don't know if you want to consider
>> them:
>> - line #4: "savedStrageties" should be "savedStrategies" ;)
>> - lines #44, #148, #202, #234: add ";"
>> - line #234: remove ";"