user_status redirect: check visibility independent of token
This commit is contained in:
parent
6a734a094b
commit
aa56023788
1 changed files with 19 additions and 24 deletions
|
@ -528,12 +528,10 @@ sub user_status {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
my $token = $self->param('token');
|
my $visibility
|
||||||
if ($token) {
|
= $self->compute_effective_visibility(
|
||||||
my $visibility = $self->compute_effective_visibility(
|
|
||||||
$user->{default_visibility_str},
|
$user->{default_visibility_str},
|
||||||
$journey->{visibility_str}
|
$journey->{visibility_str} );
|
||||||
);
|
|
||||||
if (
|
if (
|
||||||
$visibility eq 'public'
|
$visibility eq 'public'
|
||||||
or ( $visibility eq 'unlisted'
|
or ( $visibility eq 'unlisted'
|
||||||
|
@ -545,16 +543,13 @@ sub user_status {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
my $token = $self->param('token') // q{};
|
||||||
$self->redirect_to(
|
$self->redirect_to(
|
||||||
"/p/${name}/j/$journey->{id}?token=${token}-${ts}");
|
"/p/${name}/j/$journey->{id}?token=${token}-${ts}");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$self->render('not_found');
|
$self->render('not_found');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
$self->redirect_to("/p/${name}/j/$journey->{id}");
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$self->render('not_found');
|
$self->render('not_found');
|
||||||
|
|
Loading…
Reference in a new issue