feat(session): carry the bot service_language on the Session wire

Thread the Telegram bot's service language (en/ru) from the session mint response
through the gateway into the FlatBuffers Session, so the UI knows which bot the
player signed in through. handleTelegramAuth refreshes the account's service
language onto the response before minting (it was set after the fetched copy).
Empty for a non-Telegram login.
This commit is contained in:
Ilia Denisov
2026-06-15 15:49:26 +02:00
parent 711fe6e594
commit 6679260d0a
12 changed files with 61 additions and 17 deletions
+10 -8
View File
@@ -16,10 +16,11 @@ import (
// sessionResponse is the credential returned by every auth endpoint.
type sessionResponse struct {
Token string `json:"token"`
UserID string `json:"user_id"`
IsGuest bool `json:"is_guest"`
DisplayName string `json:"display_name"`
Token string `json:"token"`
UserID string `json:"user_id"`
IsGuest bool `json:"is_guest"`
DisplayName string `json:"display_name"`
ServiceLanguage string `json:"service_language"`
}
// okResponse is a simple success acknowledgement.
@@ -159,10 +160,11 @@ type errorBody struct {
// sessionResponseFor builds the credential payload for a minted session.
func sessionResponseFor(token string, acc account.Account) sessionResponse {
return sessionResponse{
Token: token,
UserID: acc.ID.String(),
IsGuest: acc.IsGuest,
DisplayName: acc.DisplayName,
Token: token,
UserID: acc.ID.String(),
IsGuest: acc.IsGuest,
DisplayName: acc.DisplayName,
ServiceLanguage: acc.ServiceLanguage,
}
}