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

When trying to verify with QR code, user is redirected to login page #545

Closed
baris83 opened this issue Apr 3, 2023 · 10 comments
Closed
Assignees

Comments

@baris83
Copy link

baris83 commented Apr 3, 2023

Hi,
I realized that, on Moodle 4.1.1 setup, when trying to verify a certificate with QR code, user is redirected to login page. I've tried it with Boost and Classic themes. We have other sites which are Moodle 3.8 and 3.11 where we use custum certificates with no such issues.

There is also another user facing this problem https://moodle.org/mod/forum/discuss.php?d=444866

Settings:
Allow anyone to verify a certificate : Yes
Allow verification of all certificates : checked

Also tried to give Guest permissions to
mod/customcert:verifycertificate
mod/customcert:verifyallcertificates

But no success

@baris83 baris83 changed the title When trying to verify with QR code, user is redireced to login page When trying to verify with QR code, user is redirected to login page Apr 3, 2023
@davefoord
Copy link

I am experiencing exactly the same issue, and have tested this on 2 separate Moodles

@mdjnelson mdjnelson added this to To Do in Next release May 5, 2023
@mdjnelson
Copy link
Owner

Seems this is a 4.x issue. Thanks for reporting. Will work on it next week.

@davefoord
Copy link

Have you been able to make any progress with this?

@mdjnelson
Copy link
Owner

Looking at it today as I set some time today to work on this project.

@mdjnelson mdjnelson moved this from To Do to In Progress in Next release May 18, 2023
@mdjnelson
Copy link
Owner

I have a Behat test for this exact scenario. I ran all the Behat scenarios for my plugin and there are a bunch of failures. I am going to have to see what is going on with more detail to get them all working.

@davidmoralesrivera
Copy link

davidmoralesrivera commented May 30, 2023

Hello, i have the same problem, i tried this to avoid the redirect:

when the certificate is generated and i scan the qr code, i get this link

mydomain.com/mod/customcert/verify_certificate.php?contextid=1304&code=d4LnWGduFg&qrcode=1

but, if i remove "contextid=1304" for example:
mydomain.com/mod/customcert/verify_certificate.php?code=d4LnWGduFg&qrcode=1
 

the redirection stops, i dont know how to remove this parameter automatically

@mdjnelson mdjnelson removed this from In Progress in Next release Jun 1, 2023
@mdjnelson mdjnelson added this to To do in 4.0.5, 4.1.1, 4.2.2 Jun 1, 2023
@mdjnelson
Copy link
Owner

mdjnelson commented Jun 4, 2023

This is what I expected was happening @davidmoralesrivera, thanks. All going well I will get a fix today.

@mdjnelson mdjnelson moved this from To do to In progress in 4.0.5, 4.1.1, 4.2.2 Jun 6, 2023
@mdjnelson mdjnelson removed this from In progress in 4.0.5, 4.1.1, 4.2.2 Jun 8, 2023
@mdjnelson mdjnelson added this to In progress in 4.0.6, 4.1.2, 4.2.3 Jun 8, 2023
@ppachas
Copy link

ppachas commented Dec 5, 2023

Hello,

To fix this issue, edit the file: /mod/customcert/element/qrcode/classes/element.php

Comment out line 161:

// 'contextid' => $issue->contextid,

Now the QR code generates the link without the "contextid" parameter and the user is no longer redirected to the login page.

This worked for me.

Greetings.

@mdjnelson mdjnelson self-assigned this Dec 28, 2023
@mdjnelson
Copy link
Owner

Got a fix for this now. I kept thinking it was an issue on the verification page and was confused because Behat covered this but it's an issue with the QR code generating an incorrect url - doh.

@mdjnelson
Copy link
Owner

Ok, pushed fix to github. It is now in the 4.0, 4.1 and 4.2 branches. :)

@mdjnelson mdjnelson moved this from In progress to Done in 4.0.6, 4.1.2, 4.2.3 Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

5 participants