redwoodjs / redwoodjs-com-archive

Public website for RedwoodJS
https://redwoodjs.com
129 stars 156 forks source link

Redirect not working as expected for Tutorial - Part 4 #288 #934

Closed muhammadmadni-ivl closed 2 years ago

muhammadmadni-ivl commented 2 years ago

Redirect not working as expected for Tutorial - Part 4 #288 https://github.com/redwoodjs/redwoodjs.com/issues/288

same issue as mentioned above package.json (web) image

image

dthyresson commented 2 years ago

Hi @muhammadmadni-ivl thanks for the note.

I have a question: your issue is about the tutorial, but the example code here is from an app using Auth0 to authenticate.

From your sample code, I would expect that if you are unauthenticated and you attempt to access say the "opportunities" or the "dna" route, your would be sent to the "login" route.

Also, since your "dnaSignatures" route path is "/" root access would bring you to the login page.

BTW - you can also set a private attribute on a Set and not use the like:

<Set wrap={DashboardLayout} private unauthenticated="login"> <Set wrap={DnaSignaturesLayout} private unauthenticated="login">

Can you share what happens when to go to a private route and not authenticated?

And can you confirm that there is no access token in storage and useAuth() hook doesn't think you are logged in.

Do you get to the "login" page?

If not, could you close this issue and report it with reproducible steps in the main Redwood issues repo https://github.com/redwoodjs/redwood/issues for the team to investigate.

Thanks

muhammadmadni-ivl commented 2 years ago

Sorry for the late reply, I have fixed the issue, its working now, again sorry for the delay. Thank you so much David Thyresson.

On Wed, Dec 29, 2021 at 8:05 PM David Thyresson @.***> wrote:

Hi @muhammadmadni-ivl https://github.com/muhammadmadni-ivl thanks for the note.

I have a question: your issue is about the tutorial, but the example code here is from an app using Auth0 to authenticate.

From your sample code, I would expect that if you are unauthenticated and you attempt to access say the "opportunities" or the "dna" route, your would be sent to the "login" route.

Also, since your "dnaSignatures" route path is "/" root access would bring you to the login page.

BTW - you can also set a private attribute on a Set and not use the like:

Can you share what happens when to go to a private route and not authenticated? And can you confirm that there is no access token in storage and useAuth() hook doesn't think you are logged in. Do you get to the "login" page? If not, could you close this issue and report it with reproducible steps in the main Redwood issues repo https://github.com/redwoodjs/redwood/issues for the team to investigate. Thanks — Reply to this email directly, view it on GitHub , or unsubscribe . Triage notifications on the go with GitHub Mobile for iOS or Android . You are receiving this because you were mentioned.Message ID: ***@***.***>