How to save the signin state #67
-
Hello! I need some help in saving signin state. I could not figure out how not to auth every time I start my app. Is it possible? Could you provide me with a code example? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hey @alex-user-go! Telegram config has Also, telegram doesn't like this way, when you signin'ing many times per short duration, telegram block you for 24+ hours due to spamming. soooo, probably you don't need to authorize this way. I agree that authorization system in tg api is not perfect, but we have what we have. |
Beta Was this translation helpful? Give feedback.
-
If anyone is struggling with this - it turned out that the testhost requires registration even though your phone is registered with a serverhost. |
Beta Was this translation helpful? Give feedback.
Hey @alex-user-go! Telegram config has
SessionFile
parameter, in this path mtproto client saves your session. telegram authorization is too unintuitive but here is the simplest explaination: when you connect to tg servers, mtproto client must store specific session credentials, so when you sendauth.signIn
request, you authorize from specific session, not in your app. (yeah, pretty strange but it is). after your session was authorized, you can send other requests from this session. Hope that i explained you as simple as i can.Also, telegram doesn't like this way, when you signin'ing many times per short duration, telegram block you for 24+ hours due to spamming. soooo, probably you don't…