Fixes: Teams with non-latin characters annot signin

This commit is contained in:
Tom Moor
2018-12-12 10:31:08 -08:00
parent 05fe573974
commit 836f9a88a2
3 changed files with 19 additions and 15 deletions

View File

@ -146,7 +146,7 @@ export default class AuthStore {
const sessions = Cookie.getJSON('sessions') || {}; const sessions = Cookie.getJSON('sessions') || {};
delete sessions[team.id]; delete sessions[team.id];
Cookie.set('sessions', sessions, { Cookie.set('sessions', JSON.stringify(sessions), {
domain: stripSubdomain(window.location.hostname), domain: stripSubdomain(window.location.hostname),
}); });
this.team = null; this.team = null;

View File

@ -116,9 +116,9 @@ export default function auth(options?: { required?: boolean } = {}) {
const sessions = JSON.stringify({ const sessions = JSON.stringify({
...existing, ...existing,
[team.id]: { [team.id]: {
name: team.name, name: encodeURIComponent(team.name),
logoUrl: team.logoUrl, logoUrl: team.logoUrl,
url: team.url, url: encodeURIComponent(team.url),
}, },
}); });
ctx.cookies.set('sessions', sessions, { ctx.cookies.set('sessions', sessions, {

View File

@ -59,18 +59,22 @@ function TopNavigation({ sessions, loggedIn }: Props) {
<MenuItem highlighted> <MenuItem highlighted>
<a>Your Teams</a> <a>Your Teams</a>
<ol> <ol>
{orderedSessions.map(session => ( {orderedSessions.map(session => {
<MenuItem key={session.url}> const url = decodeURIComponent(session.url);
<a href={`${session.url}/dashboard`}>
return (
<MenuItem key={url}>
<a href={`${url}/dashboard`}>
<TeamLogo <TeamLogo
src={session.logoUrl} src={session.logoUrl}
width={20} width={20}
height={20} height={20}
/> />
{session.name} {decodeURIComponent(session.name)}
</a> </a>
</MenuItem> </MenuItem>
))} );
})}
</ol> </ol>
</MenuItem> </MenuItem>
) : ( ) : (