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') || {};
|
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;
|
||||||
|
@ -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, {
|
||||||
|
@ -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`}>
|
|
||||||
<TeamLogo
|
return (
|
||||||
src={session.logoUrl}
|
<MenuItem key={url}>
|
||||||
width={20}
|
<a href={`${url}/dashboard`}>
|
||||||
height={20}
|
<TeamLogo
|
||||||
/>
|
src={session.logoUrl}
|
||||||
{session.name}
|
width={20}
|
||||||
</a>
|
height={20}
|
||||||
</MenuItem>
|
/>
|
||||||
))}
|
{decodeURIComponent(session.name)}
|
||||||
|
</a>
|
||||||
|
</MenuItem>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</ol>
|
</ol>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
) : (
|
) : (
|
||||||
|
Reference in New Issue
Block a user