question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lib always using cookies

See original GitHub issue

Every time I click the link in my email sent by the desive_token_auth ruby gem, it fails throwing an error saying that a variable value in the browser-cookieslibrary in the line 28 is undefined. It happens when I try to confirm an email or reset a password.

I already tested the api using the dummy app and it works fine, but it’s working using the server-side rendering configuration, which is not what I need.

I’m trying to get this working and I already went line by line for 2 days in the dummy and demo app in this library and everything seems right.

I’m just asking help because I have no more where to go.

The code I’m working can be found here: https://github.com/betoharres/redux-auth-test

A big thanks for any help here ❤️

Error Gif

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
IstoraMandiricommented, Sep 10, 2016

Also running into this issue. It doesn’t seem that clientOnly mode works because of this.

Edit: With a bit of hacking, I seem to have got this working in clientOnly mode now.

It will now try to validate the token even if initialCreds is set, whereas before it wasn’t.

https://github.com/lynndylanhurley/redux-auth/blob/master/src/utils/client-settings.js#L94-L114

  let savedCreds = retrieveData(C.SAVED_CREDS_KEY);
  let initialCreds = getCurrentSettings().initialCredentials;
  if (initialCreds) {
    // skip initial headers check (i.e. check was already done server-side)
    persistData(C.SAVED_CREDS_KEY, initialCreds);
  }
  if (savedCreds || initialCreds) {
    // verify session credentials with API
    return fetch(`${getApiUrl(currentEndpointKey)}${currentEndpoint[currentEndpointKey].tokenValidationPath}`)
    .then(response => {
          if (response.status >= 200 && response.status < 300) {
            return response.json().then(({ data }) => (data));
          }
          removeData(C.SAVED_CREDS_KEY);
          return Promise.reject({reason: "No credentials."});
    });
  } else {
    return Promise.reject({reason: "No credentials."})
  }

I haven’t tested this at all with SSR. I’m sure it will break things…

1reaction
taschettocommented, Sep 13, 2016

I believe I have the same issue… 👍 for this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Enable Cookies | Social Law Library | Boston, MA
To access the Social Law Library databases you must enable cookies. Follow the instructions below for the browser version you are using.
Read more >
Cookies & Cache - Help??? Troubleshooting for Users
Enable Cookies · Click Tools or the gear icon at the top of the browser window. · Select Internet Options. · Click the...
Read more >
Everything You Need to Know About Cookies for Web ...
Everything we covered will work in a pinch, but if you plan on working with cookies extensively, look into libraries like JavaScript Cookie...
Read more >
How to enable cookies on your mobile device - OverDrive | Help
Make sure cookies are allowed. If they aren't, tap Cookies, then tap Cookies again to allow them. Once this is set, you can...
Read more >
Understanding Cookies and Implementing them in Node.js
It will also send cookies to your browser. The cookies are then stored on your computer and submitted to the server with every...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found