Team switch using SDC Client is not possible. We should deprecate `switch_user_team` method
aponjavic opened this issue · 1 comments
When our App is used thorough browser, session_Ids are maintained through cookies and sessions are persistent between calls.
Current Team is part of the session and it get loaded from DB (lastUsedTeam) on user login.
On the other hand, when we have requests with SDC_TOKEN instead of cookies, sessions are not persistent, and they last only until request is executed, after which they are destroyed.
That is basically the reason why we have SDC_TOKEN for each (user, team) combination, because SDC_TOKEN identifies USER + TEAM.
Since SDC Client is using SDC_TOKEN, switching team is possible only by acquiring new SDC_TOKEN token for that team.
switch_user_team implementation that we have now is wrong. The effect of its execution is that is it is changing the team for that session, but that session will be destroyed at the end of that request. Next request executed with SDC_TOKEN will again have session for previous team.
Since our client is based on SDC_TOKEN, if someone want to change the team, it should create new client, with new token.
That said we should delete switch_user_team method completely, since it is redundant and can cause misleading feel that team is actually changed.
Closed this issue as the method was removed 2 years ago.