yakyak / hangupsjs

google hangouts client library for nodejs
226 stars 46 forks source link

cookiespath is touched even if jarstore is passed #42

Closed mapero closed 8 years ago

mapero commented 8 years ago

Hi,

in your README i found this description in passing a jarstore. But still you try to touch the file on clients doInit Method. Should be encapsulated in an if statement.

opts.jarstore (optional) instance of Store to use instead of default file persistence for cookies.

opts.cookiespath (optional) path to file in which to store cached login cookies. Defaults to cookies.json in module dir. not used if opts.jarstore is passed.

doInit: ->
        touch @opts.cookiespath
        @jarstore = @opts.jarstore ? new FileCookieStore(@opts.cookiespath)

Thanks

algesten commented 8 years ago

thanks!

mapero commented 8 years ago

Still it seems the lib is trying to use cookies.json? I get EACCES: permission denied, open '/usr/lib/node_modules/node-red-contrib-hangouts/node_modules/hangupsjs/cookies.json' at Error (native) if i run as user and not as root, while node is installed as global.

mapero commented 8 years ago

Sorry, it was a typo in the options. Working fine, for cookies.json.

Still refreshtoken should also be not forced to save on filesystem.