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

Forms link shows error when not logged in and shared with users #539

Closed
uli-heller opened this issue Aug 4, 2020 · 15 comments · Fixed by #763
Closed

Forms link shows error when not logged in and shared with users #539

uli-heller opened this issue Aug 4, 2020 · 15 comments · Fixed by #763
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working good first issue Good for newcomers v2 feedback Feedback from 2.x releases
Milestone

Comments

@uli-heller
Copy link

Describe the bug

I created a form, added some users to the form, copied the link to the form into an email which I sent to the users,
The form is not anonymous. When the users click on the link, they typically see something like this:

image

It reads "form not found".

However, if they log into nextcloud before clicking on the link, everything works ok.

To Reproduce
Steps to reproduce the behavior:

  1. Create a form which is not anonymous
  2. Invite some users by sending them the link to the form
  3. Ask them to activate the link without being logged in within nextcloud
  4. See error

image

Expected behavior

After clicking on the link, the user should be redirected to the login page and after logging in the form should show up.

Nextcloud (please complete the following information):

  • Nextcloud-Version: 19.0.1
  • Forms-Version: 2.0.0 and 2.0.2

Desktop (please complete the following information):

  • OS: Linux Ubuntu-20.04
  • Browser: Chrome
  • Version: 83

Browser log

JQMIGRATE: Migrate is installed, version 1.4.1
globals.js:61 $ is deprecated: The global jQuery is deprecated. It will be updated to v2.4 in Nextcloud 20 and v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own.
$ @ globals.js:61
get @ globals.js:92
(anonymous) @ previewplugin.js?v=ed49cdf0-0:149
globals.js:61 $ is deprecated: The global jQuery is deprecated. It will be updated to v2.4 in Nextcloud 20 and v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own.
$ @ globals.js:61
get @ globals.js:92
(anonymous) @ publicpage.js?v=ed49cdf0-0:23
globals.js:61 $ is deprecated: The global jQuery is deprecated. It will be updated to v2.4 in Nextcloud 20 and v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own.
$ @ globals.js:61
get @ globals.js:92
(anonymous) @ publicpage.js?v=ed49cdf0-0:36
globals.js:61 $ is deprecated: The global jQuery is deprecated. It will be updated to v2.4 in Nextcloud 20 and v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own.
$ @ globals.js:61
get @ globals.js:92
(anonymous) @ searchprovider.js?v=ed49cdf0-0:413
session-heartbeat.js:97 session heartbeat polling started
globals.js:61 $ is deprecated: The global jQuery is deprecated. It will be updated to v2.4 in Nextcloud 20 and v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own.
$ @ globals.js:61
get @ globals.js:92
(anonymous) @ previewplugin.js?v=ed49cdf0-0:150
c @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3417
P @ jquery.js:3433
globals.js:61 $ is deprecated: The global jQuery is deprecated. It will be updated to v2.4 in Nextcloud 20 and v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own.
$ @ globals.js:61
get @ globals.js:92
(anonymous) @ publicpage.js?v=ed49cdf0-0:25
c @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3417
P @ jquery.js:3433
globals.js:61 $ is deprecated: The global jQuery is deprecated. It will be updated to v2.4 in Nextcloud 20 and v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own.
$ @ globals.js:61
get @ globals.js:92
(anonymous) @ publicpage.js?v=ed49cdf0-0:29
c @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3417
P @ jquery.js:3433
globals.js:61 $ is deprecated: The global jQuery is deprecated. It will be updated to v2.4 in Nextcloud 20 and v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own.
$ @ globals.js:61
get @ globals.js:92
(anonymous) @ searchprovider.js?v=ed49cdf0-0:414
c @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3417
P @ jquery.js:3433
globals.js:61 $ is deprecated: The global jQuery is deprecated. It will be updated to v2.4 in Nextcloud 20 and v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own.
$ @ globals.js:61
get @ globals.js:92
(anonymous) @ searchprovider.js?v=ed49cdf0-0:415
c @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3417
P @ jquery.js:3433
@uli-heller uli-heller added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Aug 4, 2020
@skjnldsv
Copy link
Member

skjnldsv commented Aug 4, 2020

Hey!
I will need a screenshot of your network requests.
Before you do anything, still on the development tools, there is a tab called network. Click on it and then the xhr filter. Open the form and screenshot the network log like this:
capture d ecran_2018-09-27_21-49-46

Click on the request and select the "response" tab, copy and paste the entire response content here please.
Capture d’écran_2020-08-04_08-16-50

@skjnldsv skjnldsv added needs info Not enough information provided v2 feedback Feedback from 2.x releases labels Aug 4, 2020
@uli-heller
Copy link
Author

image

@skjnldsv : The list of requests/responses is empty when XHR is activated.

@skjnldsv
Copy link
Member

skjnldsv commented Aug 4, 2020

I mean from the admin side, not the public :)

@uli-heller
Copy link
Author

uli-heller commented Aug 4, 2020

Sorry, I do not understand what you want me to do... Logging into Nextcloud and jumping into the edit mode of the form? And collecting network responses during this procedure? This will not reproduce the error...

@skjnldsv
Copy link
Member

skjnldsv commented Aug 4, 2020

Logging into Nextcloud and jumping into the edit mode of the form? And collecting network responses during this procedure? This will not reproduce the error...

Yes, please do that.
I don't want to reproduce the error, but to get the form data :)

@uli-heller
Copy link
Author

uli-heller commented Aug 4, 2020

image

{
  "id": 3,
  "hash": "f9HsiwmsiL8LpfTj",
  "title": "Externer Datenträger",
  "description": "Mit dieser Umfrage versuche ich zu ermitteln, welche Anforderungen die DP-Mitarbeiter an einen externen Datenträger haben. Die MA-Anforderungen werden dann mit den Datenschutz-Anforderungen abgeglichen und umgesetzt.",
  "ownerId": "uli",
  "created": 1596451456,
  "access": {
    "users": [
      {
        "shareWith": "agutjahr",
        "displayName": "Annette Gutjahr",
        "shareType": 0
      },
      {
        "shareWith": "smeyer",
        "displayName": "Sören Meyer",
        "shareType": 0
      },
      {
        "shareWith": "smotzer",
        "displayName": "Steffen Motzer",
        "shareType": 0
      },
      {
        "shareWith": "jgutjahr",
        "displayName": "Jasmin Gutjahr",
        "shareType": 0
      }
    ],
    "groups": [],
    "type": "selected"
  },
  "expires": 0,
  "isAnonymous": false,
  "submitOnce": true,
  "questions": [
    {
      "id": 11,
      "formId": 3,
      "order": 1,
      "type": "multiple",
      "mandatory": false,
      "text": "Mit welchem Betriebssystem greifst Du auf den Datenträger zu?",
      "options": [
        {
          "id": 11,
          "questionId": 11,
          "text": "Linux"
        },
        {
          "id": 12,
          "questionId": 11,
          "text": "Windows"
        },
        {
          "id": 13,
          "questionId": 11,
          "text": "MacOS"
        },
        {
          "id": 14,
          "questionId": 11,
          "text": "Android"
        },
        {
          "id": 15,
          "questionId": 11,
          "text": "iOS"
        },
        {
          "id": 16,
          "questionId": 11,
          "text": "sonstiges"
        }
      ]
    },
    {
      "id": 12,
      "formId": 3,
      "order": 2,
      "type": "multiple_unique",
      "mandatory": false,
      "text": "Kommst Du mit einem vollverschlüsselten Datenträger zurecht?",
      "options": [
        {
          "id": 17,
          "questionId": 12,
          "text": "Ja"
        },
        {
          "id": 18,
          "questionId": 12,
          "text": "Nein"
        },
        {
          "id": 19,
          "questionId": 12,
          "text": "Was ist das? Weiß nicht!"
        }
      ]
    },
    {
      "id": 13,
      "formId": 3,
      "order": 3,
      "type": "multiple_unique",
      "mandatory": false,
      "text": "Benötigst Du einen unverschlüsselten Teilbereich auf dem Datenträger?",
      "options": [
        {
          "id": 20,
          "questionId": 13,
          "text": "Ja"
        },
        {
          "id": 21,
          "questionId": 13,
          "text": "Nein"
        }
      ]
    },
    {
      "id": 14,
      "formId": 3,
      "order": 4,
      "type": "short",
      "mandatory": false,
      "text": "Falls Du einen unverschlüsselten Teilbereich benötigst: Wofür?",
      "options": []
    },
    {
      "id": 15,
      "formId": 3,
      "order": 5,
      "type": "multiple_unique",
      "mandatory": false,
      "text": "Benötigst Du einen USB-Stick?",
      "options": [
        {
          "id": 22,
          "questionId": 15,
          "text": "Ja"
        },
        {
          "id": 23,
          "questionId": 15,
          "text": "Nein"
        }
      ]
    },
    {
      "id": 16,
      "formId": 3,
      "order": 6,
      "type": "short",
      "mandatory": false,
      "text": "Falls Du einen USB-Stick benötigst: Wofür?",
      "options": []
    }
  ]
}```

@skjnldsv
Copy link
Member

skjnldsv commented Aug 4, 2020

  "access": {
    "users": [
      {
        "shareWith": "agutjahr",
        "displayName": "Annette Gutjahr",
        "shareType": 0
      },
      {
        "shareWith": "smeyer",
        "displayName": "Sören Meyer",
        "shareType": 0
      },
      {
        "shareWith": "smotzer",
        "displayName": "Steffen Motzer",
        "shareType": 0
      },
      {
        "shareWith": "jgutjahr",
        "displayName": "Jasmin Gutjahr",
        "shareType": 0
      }
    ],
    "groups": [],
    "type": "selected"
  },

This is not a public share, unless you're accessing it logged as one of those users, it will not let you display it

@skjnldsv skjnldsv added invalid This doesn't seem right and removed 0. Needs triage Pending approval or rejection. This issue is pending approval. needs info Not enough information provided labels Aug 4, 2020
@skjnldsv skjnldsv closed this as completed Aug 4, 2020
@uli-heller
Copy link
Author

uli-heller commented Aug 4, 2020 via email

@skjnldsv
Copy link
Member

skjnldsv commented Aug 4, 2020

Yes, this is something that needs improvement :)
For the mail invitation: #541

I guess we could redirect to the login page if this is a user share and no one is logged in @jotoeri ?
cc @jancborchardt

@skjnldsv skjnldsv reopened this Aug 4, 2020
@skjnldsv skjnldsv added the discussion Being discussed label Aug 4, 2020
@jotoeri
Copy link
Member

jotoeri commented Aug 4, 2020

Jep, sounds useful. Redirect if shared to instance or specific users and only show 'not existent' on public links... 👍

@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of and removed discussion Being discussed invalid This doesn't seem right labels Aug 4, 2020
@skjnldsv skjnldsv changed the title Forms link shows error when not logged in Forms link shows error when not logged in and shared with users Aug 4, 2020
@skjnldsv skjnldsv added the good first issue Good for newcomers label Aug 4, 2020
@larsfu
Copy link

larsfu commented Aug 21, 2020

@uli-heller I have the same problem, as a workaround you can share a link in the form https://nextcloud.domain.tld/login?redirect_url=/apps/forms/yourformid this will show the login page or redirect to the form immediately if already logged in.

@uli-heller
Copy link
Author

uli-heller commented Aug 22, 2020

@larsfu thx a lot, perfect

@ridhwn

This comment has been minimized.

@laurisb

This comment has been minimized.

@skjnldsv skjnldsv modified the milestones: 2.1, 2.2 Jan 21, 2021
uli-heller added a commit to uli-heller/forms that referenced this issue Jan 29, 2021
uli-heller added a commit to uli-heller/forms that referenced this issue Jan 29, 2021
uli-heller added a commit to uli-heller/forms that referenced this issue Jan 29, 2021
uli-heller added a commit to uli-heller/forms that referenced this issue Jan 29, 2021
Signed-off-by: Uli Heller <uli.heller@daemons-point.com>
@larsfu
Copy link

larsfu commented Feb 17, 2021

hi @larsfu this manual solution doesn't work for me? it will open the default main page after login rather than the forms

I just tried it again, it still works for me.

@jotoeri jotoeri linked a pull request Feb 24, 2021 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working good first issue Good for newcomers v2 feedback Feedback from 2.x releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants