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

sessionToken gone? #159

Closed
sivertheisholt opened this issue Mar 23, 2024 · 38 comments
Closed

sessionToken gone? #159

sivertheisholt opened this issue Mar 23, 2024 · 38 comments

Comments

@sivertheisholt
Copy link
Contributor

Looks like sessionToken is gone as they have moved to https://character.ai/?

It doesn't show up if I go back to the old page anymore either.

@then77
Copy link
Contributor

then77 commented Mar 23, 2024

not really, but its harder to find. recommend try to go to the old website instead. https://old.character.ai/ (it just the same as the beta version)

but if you still curious, yes it's still possible at least for now.
go to network tab, try to click any of the AI character, then find something like this (anything that says plus.character.ai)
image

and you'll find it in the request authorization header.
image

@sivertheisholt
Copy link
Contributor Author

not really, but its harder to find. recommend try to go to the old website instead. https://old.character.ai/ (it just the same as the beta version)

but if you still curious, yes it's still possible at least for now. go to network tab, try to click any of the AI character, then find something like this (anything that says plus.character.ai) image

and you'll find it in the request authorization header. image

Thank you! :)

The readme might need an update for this @realcoloride

@realcoloride
Copy link
Owner

Hello, i'll investigate and see.

I will keep you updated!

@realcoloride
Copy link
Owner

image
Hello there, upon investigation, for the new UI, you can check the session token there.

I havent tested yet but it seems like it matches when doing requests & I will update the README to include for the new and old interface.

I will keep you updated!

@iegl3
Copy link

iegl3 commented Apr 9, 2024

image Hello there, upon investigation, for the new UI, you can check the session token there.

I havent tested yet but it seems like it matches when doing requests & I will update the README to include for the new and old interface.

I will keep you updated!

are they changed the sessionToken method again? i can't find any key related to this

@realcoloride
Copy link
Owner

realcoloride commented Apr 9, 2024

are they changed the sessionToken method again? i can't find any key related to this

You can still find it in the cookies (in the new interface).

@amoeher
Copy link

amoeher commented Apr 9, 2024

Yea, for me, it appeared after refreshing the page while standing on the chat

@realcoloride
Copy link
Owner

That must mean you were logged off and logged in back.

@iegl3
Copy link

iegl3 commented Apr 9, 2024

That must mean you were logged off and logged in back.

okay i got the token, and where should i put these token now?

@realcoloride
Copy link
Owner

See README.md for an example usage.

@ThisMe124
Copy link

ThisMe124 commented Apr 10, 2024

image Hello there, upon investigation, for the new UI, you can check the session token there.

I havent tested yet but it seems like it matches when doing requests & I will update the README to include for the new and old interface.

I will keep you updated!

I can't find that Token

@iegl3
Copy link

iegl3 commented Apr 10, 2024

See README.md for an example usage.

i've already read your readme 10 times but still cant find the information about how to use the token

@sivertheisholt
Copy link
Contributor Author

See README.md for an example usage.

i've already read your readme 10 times but still cant find the information about how to use the token

image

@iegl3
Copy link

iegl3 commented Apr 10, 2024

See README.md for an example usage.

i've already read your readme 10 times but still cant find the information about how to use the token

image

yeah i know this, the problem is where should i specify the token?
image
bukti

@sivertheisholt
Copy link
Contributor Author

See README.md for an example usage.

i've already read your readme 10 times but still cant find the information about how to use the token

image

yeah i know this, the problem is where should i specify the token? image bukti

You pass the token into the authenticateWithToken function like this:

.authenticateWithToken("insert token here");

@iegl3
Copy link

iegl3 commented Apr 10, 2024

See README.md for an example usage.

i've already read your readme 10 times but still cant find the information about how to use the token

image

yeah i know this, the problem is where should i specify the token? image bukti

You pass the token into the authenticateWithToken function like this:

.authenticateWithToken("insert token here");

ah i see.. okay it's clear, thanks for solution

@realcoloride
Copy link
Owner

image Hello there, upon investigation, for the new UI, you can check the session token there.
I havent tested yet but it seems like it matches when doing requests & I will update the README to include for the new and old interface.
I will keep you updated!

I can't find that Token

Hello, have you tried refreshing or getting the token via sniffing the network requests?

@sivertheisholt
Copy link
Contributor Author

@realcoloride do you think it would be possible to add a way for users to log in themself via a browser popup, then retrieve the token directly?

@realcoloride
Copy link
Owner

@realcoloride do you think it would be possible to add a way for users to log in themself via a browser popup, then retrieve the token directly?

Hello, while that might be possible (I believe you are referencing something like the OpenAI free package), I do not plan on adding such a feature for now. However, a user friendly version with a simple code (in the README.md) to copy & paste in the old beta UI should still do the trick.

@sivertheisholt
Copy link
Contributor Author

That must mean you were logged off and logged in back.

Trying this myself, and the HTTP_AUTHORIZATION doesn't get set before navigating to chat.

@realcoloride
Copy link
Owner

That must mean you were logged off and logged in back.

Trying this myself, and the HTTP_AUTHORIZATION doesn't get set before navigating to chat.

Right, thanks for letting me know

@ThisMe124
Copy link

image Hello there, upon investigation, for the new UI, you can check the session token there.
I havent tested yet but it seems like it matches when doing requests & I will update the README to include for the new and old interface.
I will keep you updated!

I can't find that Token

Hello, have you tried refreshing or getting the token via sniffing the network requests?

Fixed i found the token

@KuntilBogel
Copy link

@realcoloride this is the updated readme code

(function(){let e=JSON.parse(document.querySelector("#__NEXT_DATA__").text)?.props?.pageProps?.token;if(!e){alert("You need to log in first! Or access a character page");return;}document.documentElement.innerHTML=`<div><i><p>provided by node_characterai - <a href="https://github.com/realcoloride/node_characterai?tab=readme-ov-file#using-an-access-token">click here for more information</a></p></i><p>Here is your session token:</p><input value="${e}" readonly><p><strong>Do not share this with anyone unless you know what you are doing! This is your personal session token. If stolen or requested by someone you don't trust, they could access your account without your consent; if so, please close the page immediately.</strong></p><button id="copy" onclick="navigator.clipboard.writeText('${e}'); alert('Copied to clipboard!')">Copy session token to clipboard</button><button onclick="window.location.reload();">Refresh the page</button></div>`;e=null;})();

@realcoloride
Copy link
Owner

@realcoloride this is the updated readme code

(function(){let e=JSON.parse(document.querySelector("#__NEXT_DATA__").text)?.props?.pageProps?.token;if(!e){alert("You need to log in first! Or access a character page");return;}document.documentElement.innerHTML=`<div><i><p>provided by node_characterai - <a href="https://github.com/realcoloride/node_characterai?tab=readme-ov-file#using-an-access-token">click here for more information</a></p></i><p>Here is your session token:</p><input value="${e}" readonly><p><strong>Do not share this with anyone unless you know what you are doing! This is your personal session token. If stolen or requested by someone you don't trust, they could access your account without your consent; if so, please close the page immediately.</strong></p><button id="copy" onclick="navigator.clipboard.writeText('${e}'); alert('Copied to clipboard!')">Copy session token to clipboard</button><button onclick="window.location.reload();">Refresh the page</button></div>`;e=null;})();

Do you quote this for the new interface?

@gamersindo1223
Copy link

@realcoloride yeah

@gamersindo1223
Copy link

and just asking is it just me or is the package currently broken?

@gamersindo1223
Copy link

cuz sometimes I got ProtocolError: Could not load body for this request. This might happen if the request is a preflight request.

@realcoloride
Copy link
Owner

and just asking is it just me or is the package currently broken?

Works fine to me.
If you get an error, please make sure to either open an issue or let me know.

@realcoloride
Copy link
Owner

@realcoloride yeah

I'll review the code and consider adding this to the README.md. Thank you for the contribution

@Momenx1
Copy link

Momenx1 commented May 3, 2024

image Hello there, upon investigation, for the new UI, you can check the session token there.

I havent tested yet but it seems like it matches when doing requests & I will update the README to include for the new and old interface.

I will keep you updated!

Hey man i can't find that token

@realcoloride
Copy link
Owner

image Hello there, upon investigation, for the new UI, you can check the session token there.

I havent tested yet but it seems like it matches when doing requests & I will update the README to include for the new and old interface.

I will keep you updated!

Hey,

Have you tried this?

Cheers

@sivertheisholt
Copy link
Contributor Author

image Hello there, upon investigation, for the new UI, you can check the session token there.
I havent tested yet but it seems like it matches when doing requests & I will update the README to include for the new and old interface.
I will keep you updated!

Hey man i can't find that token

You have to open a chat for it to set the token.

@Momenx1
Copy link

Momenx1 commented May 4, 2024

image Hello there, upon investigation, for the new UI, you can check the session token there.
I havent tested yet but it seems like it matches when doing requests & I will update the README to include for the new and old interface.
I will keep you updated!

Hey,

Have you tried this?

Cheers

i have tried it and i can't find it

@Momenx1
Copy link

Momenx1 commented May 4, 2024

image Hello there, upon investigation, for the new UI, you can check the session token there.
I havent tested yet but it seems like it matches when doing requests & I will update the README to include for the new and old interface.
I will keep you updated!

Hey,

Have you tried this?

Cheers

Screenshot (1)

I can't find it

@sivertheisholt
Copy link
Contributor Author

image Hello there, upon investigation, for the new UI, you can check the session token there.
I havent tested yet but it seems like it matches when doing requests & I will update the README to include for the new and old interface.
I will keep you updated!

Hey,
Have you tried this?
Cheers

Screenshot (1)

I can't find it

It should show up once you go into a chat with a character, if not maybe a relog will work:

image

@Momenx1
Copy link

Momenx1 commented May 5, 2024

image Hello there, upon investigation, for the new UI, you can check the session token there.
I havent tested yet but it seems like it matches when doing requests & I will update the README to include for the new and old interface.
I will keep you updated!

Hey,
Have you tried this?
Cheers

Screenshot (1)
I can't find it

It should show up once you go into a chat with a character, if not maybe a relog will work:

image

Yup tried it and relogged and i can't find it.

@realcoloride
Copy link
Owner

Alright, I'll investigate and look into it.

@realcoloride
Copy link
Owner

Tokens should be the same. For upcoming news, see #180

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

9 participants