Skip to content

Conversation

@remicastaing
Copy link
Contributor

  • replace ngCookies by ngStorage: ngCookies only supports session
    cookies; ngStorage supports both local and session storage
  • add remember me checkbox in login.html and login.jade
  • pass remember me parameter to auth.service in login.controller
  • replace $cookieStore by $localStorage and $sessionStorage in
    app.js/coffee
  • replace $cookieStore by $localStorage and $sessionStorage in
    auth.service.js/coffee
  • add an expire parameter to signToken method in the server side
    auth.service.js

Notes:

  • $sessionStorage is used when « remember me » is not checked
  • $localStorage is used when « remember me » is checked
  • with « remember me » checked, the token will expire after 7 days

Closes #259 (partly)

- replace ngCookies by ngStorage: ngCookies only supports session
cookies / ngStorage supports both local and session storage
- add remember me checkbox in login.html and login.jade
- pass remember me parameter to auth.service in login.controller
- replace $cookieStore by $localStorage and $sessionStorage in
app.js/coffee
- replace $cookieStore by $localStorage and $sessionStorage in
auth.service.js/coffee
- add an expire parameter to signToken method in the server side
auth.service.js

Notes:
- $sessionStorage is used when « remember me » is not checked
- $localStorage is used when « remember me » is checked
- with « remember me » checked, the token will expire after 7 days

Closes #259 (partly)
@DaftMonk
Copy link
Member

You'll need to add ngstorage to the fixtures to get the tests to pass: https://github.com/DaftMonk/generator-angular-fullstack/blob/master/test/fixtures/bower.json

@remicastaing
Copy link
Contributor Author

I added ngstorage in test/fixtures/bower.jsonand also in app/template/karma.conf.js. But it didn't work.

I don't understand npm test fails:

1) angular-fullstack generator running app "before each" hook:
     Error: ENOENT, no such file or directory '/Users/remi/Workspaces/JS/generator-angular-fullstack/test/fixtures/node_modules'
      at Object.fs.lstatSync (fs.js:684:18)
      at Object.copySync (/Users/remi/Workspaces/JS/generator-angular-fullstack/node_modules/fs-extra/lib/copy.js:61:18)
      at Context.<anonymous> (/Users/remi/Workspaces/JS/generator-angular-fullstack/test/test-file-creation.js:85:10)
      at Hook.Runnable.run (/Users/remi/Workspaces/JS/generator-angular-fullstack/node_modules/mocha/lib/runnable.js:211:32)
      at next (/Users/remi/Workspaces/JS/generator-angular-fullstack/node_modules/mocha/lib/runner.js:249:10)
      at Object._onImmediate (/Users/remi/Workspaces/JS/generator-angular-fullstack/node_modules/mocha/lib/runner.js:261:5)
      at processImmediate [as _immediateCallback] (timers.js:336:15)

@meeDamian
Copy link
Contributor

  1. cd test/fixtures && npm update && bower update && cd ../..
  2. npm test

- replace angular-cookies by ngStorage
@remicastaing
Copy link
Contributor Author

Yabadabadooo! Thanks @DaftMonk, @chester1000. It works both locally and on Travis.

@DaftMonk
Copy link
Member

DaftMonk commented Aug 3, 2014

I can't check this out locally. It says Branch "remember_me" does not exist in the repository.

@remicastaing
Copy link
Contributor Author

Sorry, I removed it accidentally from my github repo.

@remicastaing
Copy link
Contributor Author

Her, a new PR: #415

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forgot password/Remember me

4 participants