Redirect logged out users to canonical URLs for remote accounts
This is clearer for users (showing all posts, as one would expect), while patching a potential vector for leaking information to search engines/etc. Related: #2225, mastodon/mastodon#21203pull/2299/head
parent
a0047184d7
commit
72d92c77e8
|
@ -74,6 +74,10 @@ RemoteHint.propTypes = {
|
||||||
|
|
||||||
class AccountTimeline extends ImmutablePureComponent {
|
class AccountTimeline extends ImmutablePureComponent {
|
||||||
|
|
||||||
|
static contextTypes = {
|
||||||
|
identity: PropTypes.object,
|
||||||
|
};
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
params: PropTypes.shape({
|
params: PropTypes.shape({
|
||||||
acct: PropTypes.string,
|
acct: PropTypes.string,
|
||||||
|
@ -96,7 +100,11 @@ class AccountTimeline extends ImmutablePureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
_load () {
|
_load () {
|
||||||
const { accountId, withReplies, params: { tagged }, dispatch } = this.props;
|
const { accountId, withReplies, remote, remoteUrl, params: { tagged }, dispatch } = this.props;
|
||||||
|
|
||||||
|
if (remote && !this.context.identity.signedIn) {
|
||||||
|
window.location.replace(remoteUrl);
|
||||||
|
}
|
||||||
|
|
||||||
dispatch(fetchAccount(accountId));
|
dispatch(fetchAccount(accountId));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue