Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not fetch user status if current user is a guest #1379

Merged

Conversation

danxuliu
Copy link
Contributor

@danxuliu danxuliu commented Sep 2, 2020

The user status endpoint is not available for guests, only for logged in users. As the request will always fail if the current user is a guest there should be no need to perform it.

Note, however, that this will prevent user statuses to be shown on the avatars in public share pages, even if the current user is actually logged in. Public share pages are opened in incognito mode, so getCurrentUser returns null. However, if the current user is logged in requests to the API would work without problems, so technically it would be possible to fetch the user statuses.

Due to the problem described in last paragraph I am not sure if this should be merged or not. In fact the more I think about it the less I like this pull request :-P Opinions?

The user status endpoint is not available for guests, only for
logged in users. As the request will always fail if the current user is
a guest there should be no need to perform it.

Note, however, that this will prevent user statuses to be shown on the
avatars in public share pages, even if the current user is actually
logged in. Public share pages are opened in ncognito mode, so
"getCurrentUser" returns null. However, if the current user is logged in
requests to the API would work without problems, so technically it would
be possible to fetch the user statuses.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu added bug Something isn't working 3. to review Waiting for reviews feature: avatar Related to the avatar component discussion Need advices, opinions or ideas on this topic labels Sep 2, 2020
@juliusknorr
Copy link
Contributor

@georgehrke Not sure if there were plans about making status endpoints available for public access?

@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Sep 3, 2020
@georgehrke
Copy link
Contributor

@georgehrke Not sure if there were plans about making status endpoints available for public access?

No, not at the moment

@georgehrke georgehrke merged commit e4ba3a1 into master Sep 3, 2020
@georgehrke georgehrke deleted the do-not-fetch-user-status-if-current-user-is-a-guest branch September 3, 2020 06:44
nickvergessen added a commit to nextcloud/spreed that referenced this pull request Sep 3, 2020
Ref nextcloud-libraries/nextcloud-vue#1379

Signed-off-by: Joas Schilling <coding@schilljs.com>
@dartcafe
Copy link
Contributor

dartcafe commented Sep 6, 2020

I know, this is already merged, but: Avoid loading the user status for non users is developed in the avatar component (#1348). For guests it is developed in the status component. This looks inconsistent. Shouldn't this be solved together in the same app component?

@nickvergessen
Copy link
Contributor

Those are 2 different things. #1348 is to not try to render a status for an avatar of non users. This here is because guests will never be able to load any status info for others (atm), independent from which component the request is coming from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug Something isn't working discussion Need advices, opinions or ideas on this topic feature: avatar Related to the avatar component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants