Project

General

Profile

Actions

Task #104694

closed

[DOCS] Document how to implement a redirect to the restricted page after successful login

Added by Sandra Erbel 3 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Documentation
Target version:
Start date:
2024-08-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Sprint Focus:

Description

Provide documentation to implement a redirect to the restricted page after a successful frontend login

Problem description

A common use case that a frontend user might expect is that when a frontend user (not logged in yet) tries to access a restricted page, then the user should be redirected to the login page. This is already covered in the documentation.

But after the login you may want to be redirected to the page from where you got initially redirected to and not to the page that you can select in the frontend login plugin. This is not yet covered by the documentation (https://docs.typo3.org/c/typo3/cms-felogin/main/en-us/Examples/Index.html#login-and-back-to-original-page).

I will provide the documentation that this sentence is referring to (Sending those direct visits to a login page is not a job of the felogin plugin, but requires a custom page-not-found handler).

Connections to Torbens issue

Torben Hansen (https://forge.typo3.org/issues/101252) provided a not yet merged (as of the time of this writing) solution for this but in another manner than I want to document about.

He suggests to use the RedirectLoginErrorHandler class in terms of a LoginRedirect errorHandler, but I will document the RedirectLoginErrorHandler in the use of custom PHP 403 errorHandler in the error handling (site settings) which a backend user can provide by its own.

I tried to implement the other way (RedirectLoginErrorHandler class in terms of a LoginRedirect errorHandler) but this didn't work out in a TYPO3 instance with version v11.5.37 - after a successful login we ran into the 403 (The page did not exist or was inaccessible. Reason: ID was not an accessible page) error again. Garvin and me therefore tried the other way and succeeded with small modification of the code in the RedirectLoginErrorHandler class.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #101252: PageErrorHandler for 403 errors with redirect option to login pageClosedTorben Hansen2023-07-05

Actions
Actions #1

Updated by Sandra Erbel 3 months ago

  • Related to Feature #101252: PageErrorHandler for 403 errors with redirect option to login page added
Actions #2

Updated by Garvin Hicking 3 months ago

  • Description updated (diff)
  • Status changed from New to Accepted
  • Assignee set to Garvin Hicking
  • Target version set to next-patchlevel
Actions #3

Updated by Garvin Hicking 3 months ago

  • Assignee changed from Garvin Hicking to Sandra Erbel

Sandra will try to move this PR from:

https://github.com/TYPO3-CMS/felogin/pull/1

as a proper gerrit patch to the docs :)

Actions #4

Updated by Gerrit Code Review 3 months ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #5

Updated by Gerrit Code Review 3 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #6

Updated by Gerrit Code Review 3 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #7

Updated by Gerrit Code Review 3 months ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #8

Updated by Gerrit Code Review 3 months ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #9

Updated by Gerrit Code Review 3 months ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #10

Updated by Gerrit Code Review 3 months ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #11

Updated by Gerrit Code Review 3 months ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #12

Updated by Gerrit Code Review 3 months ago

Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #13

Updated by Gerrit Code Review 3 months ago

Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #14

Updated by Gerrit Code Review 3 months ago

Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #15

Updated by Gerrit Code Review 3 months ago

Patch set 12 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #16

Updated by Gerrit Code Review 3 months ago

Patch set 13 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #17

Updated by Gerrit Code Review 3 months ago

Patch set 14 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #18

Updated by Gerrit Code Review 3 months ago

Patch set 15 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #19

Updated by Gerrit Code Review 3 months ago

Patch set 16 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #20

Updated by Gerrit Code Review 3 months ago

Patch set 17 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #21

Updated by Gerrit Code Review 3 months ago

Patch set 18 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817

Actions #22

Updated by Sandra Erbel 3 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #23

Updated by Gerrit Code Review 3 months ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85876

Actions #24

Updated by Gerrit Code Review 3 months ago

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85877

Actions #25

Updated by Sandra Erbel 3 months ago

  • Status changed from Under Review to Resolved
Actions #26

Updated by Benni Mack about 1 month ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF