Fixes: Teams with non-latin characters annot signin
This commit is contained in:
@ -146,7 +146,7 @@ export default class AuthStore {
|
||||
const sessions = Cookie.getJSON('sessions') || {};
|
||||
delete sessions[team.id];
|
||||
|
||||
Cookie.set('sessions', sessions, {
|
||||
Cookie.set('sessions', JSON.stringify(sessions), {
|
||||
domain: stripSubdomain(window.location.hostname),
|
||||
});
|
||||
this.team = null;
|
||||
|
@ -116,9 +116,9 @@ export default function auth(options?: { required?: boolean } = {}) {
|
||||
const sessions = JSON.stringify({
|
||||
...existing,
|
||||
[team.id]: {
|
||||
name: team.name,
|
||||
name: encodeURIComponent(team.name),
|
||||
logoUrl: team.logoUrl,
|
||||
url: team.url,
|
||||
url: encodeURIComponent(team.url),
|
||||
},
|
||||
});
|
||||
ctx.cookies.set('sessions', sessions, {
|
||||
|
@ -59,18 +59,22 @@ function TopNavigation({ sessions, loggedIn }: Props) {
|
||||
<MenuItem highlighted>
|
||||
<a>Your Teams</a>
|
||||
<ol>
|
||||
{orderedSessions.map(session => (
|
||||
<MenuItem key={session.url}>
|
||||
<a href={`${session.url}/dashboard`}>
|
||||
{orderedSessions.map(session => {
|
||||
const url = decodeURIComponent(session.url);
|
||||
|
||||
return (
|
||||
<MenuItem key={url}>
|
||||
<a href={`${url}/dashboard`}>
|
||||
<TeamLogo
|
||||
src={session.logoUrl}
|
||||
width={20}
|
||||
height={20}
|
||||
/>
|
||||
{session.name}
|
||||
{decodeURIComponent(session.name)}
|
||||
</a>
|
||||
</MenuItem>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</ol>
|
||||
</MenuItem>
|
||||
) : (
|
||||
|
Reference in New Issue
Block a user