Uh oh!
There was an error while loading. Please reload this page.
feat: redirect after login to entrance url - #789
Conversation
datamweb
commented
Aug 15, 2023
Thank you very much for your PR. Please note that commit writing must be with the following description: Please write unit test for PR: |
kenjis
commented
Aug 15, 2023
The |
datamweb
commented
Aug 17, 2023
@mshannaq Please do not use |
datamweb
commented
Aug 18, 2023
It seems you have 2 ways to fix error Detect Merge Commits.
I try to use git branch beforeLogginUrl.bk beforeLogginUrlgit rebase -i origin/beforeLogginUrl~5After your above command, your editor will open as follows. Now modify the items in the editor as follows. And after that save the file and close the editor: Now wait a bit. If you are asked for a password, enter your password. Your editor will open again as follows: You should edit the file as follows and then save it. After that, close the editor: If you have done everything correctly, you should see the following message in your terminal. git push -f origin beforeLogginUrlThe above method is called squash. After executing the commands, your 5 commits should become 1 commit with message To be honest, these topics are complicated for me too, I hope you can handle it. |
@datamweb $ git log --oneline 8bf8c4f (HEAD -> beforeLogginUrl) feat: redirect after login to entrance url379a201 Merge branch 'beforeLogginUrl' of https://github.com/mshannaq/ci4-shield into beforeLogginUrl03f3a2c feat: redirect after login to entrance urlb099984 Merge branch 'codeigniter4:develop' into beforeLogginUrl78cac54 (upstream/develop, origin/develop, origin/HEAD, develop) Merge pull request #788 from codeigniter4/datamweb-add-status-badge89549c3 Merge pull request #782 from kenjis/update-RELEASE.md2d0ec09 Merge pull request #787 from datamweb/fix-style-code27b4323 Redirect after login to entrance url #722Update your $ git fetch upstream
$ git switch develop
$ git merge upstream/develop
$ git push origin developSwitch to the PR branch: $ git switch beforeLogginUrlSwitched to branch 'beforeLogginUrl'Do $ git rebase upstream/developSuccessfully rebased and updated refs/heads/beforeLogginUrl.$ git log --oneline 0ace028 (HEAD -> beforeLogginUrl) feat: redirect after login to entrance urlac9173c feat: redirect after login to entrance url97d92be Redirect after login to entrance url #72278cac54 (upstream/develop, origin/develop, origin/HEAD, develop) Merge pull request #788 from codeigniter4/datamweb-add-status-badge |
kenjis
commented
Aug 18, 2023
@mshannaq After If you can, please squash them into one commit. |
| { | ||
| $url = setting('Auth.redirects')['login']; | ||
| $session = session(); | ||
| $url = $session->getTempdata('beforeLogginUrl') ?? setting('Auth.redirects')['login']; |
There was a problem hiding this comment.
| $url = $session->getTempdata('beforeLogginUrl') ?? setting('Auth.redirects')['login']; | |
| $url = $session->getTempdata('beforeLoginUrl') ?? setting('Auth.redirects')['login']; |
| if (! url_is('login')) { | ||
| $session = session(); | ||
| $session->setTempdata('beforeLogginUrl', current_url(), 300); |
There was a problem hiding this comment.
| $session->setTempdata('beforeLogginUrl', current_url(), 300); | |
| $session->setTempdata('beforeLoginUrl', current_url(), 300); |
| $result->assertRedirectTo('/login'); | ||
| $this->assertNotEmpty($_SESSION['beforeLogginUrl']); | ||
| $this->assertSame(site_url('protected-route'), $_SESSION['beforeLogginUrl']); |
There was a problem hiding this comment.
All superglobals should be removed. So please use the Session class.
| $result->assertRedirectTo('/login'); | |
| $this->assertNotEmpty($_SESSION['beforeLogginUrl']); | |
| $this->assertSame(site_url('protected-route'), $_SESSION['beforeLogginUrl']); | |
| $result->assertRedirectTo('/login'); | |
| $session = session(); | |
| $this->assertNotEmpty($session->get('beforeLogginUrl')); | |
| $this->assertSame(site_url('protected-route'), $session->get('beforeLogginUrl')); |
mshannaq
commented
Aug 20, 2023
I created a new branch and apply the changes into as it more easy and then I submit a PR793 |





Redirect after login to entrance url
closes #722