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

Problems with authentication state #109

Open
louis030195 opened this issue Aug 1, 2023 · 0 comments
Open

Problems with authentication state #109

louis030195 opened this issue Aug 1, 2023 · 0 comments

Comments

@louis030195
Copy link

louis030195 commented Aug 1, 2023

Basically (already logged in previously in the same client session):

Does not receive any brain waves:

await neurosity.login({
    customToken: customToken,
}).catch((e) => {
    console.log(e) // Already logged in ...
})
neurosity.brainwaves("powerByBand").subscribe(console.log)

Does receive brain waves:

await neurosity.logout()
await neurosity.login({
    customToken: customToken,
}).catch((e) => {
    console.log(e)
})

neurosity.brainwaves("powerByBand").subscribe(console.log)

Same was happening with email and password

I have to logout and login the client every time

I had other issues related to state, I don't know if it's related to my environment: NextJS app dir 13.4.3 i run all this client-side in 'use client' components

Or is it because I am "already connected" I cannot receive brainwaves?

also I believe neurosity SDK crashes in edge runtime (will open an issue when I see it again)

Is the neurosity SDK storing tokens somewhere somehow? Ideally I can just instantiate the neurosity object once and authenticate it once and use it everywhere client-side
Of course for server-side it would require to re-instanciate and authenticate

PS: just doing the logout atm as work around and it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant