-
Notifications
You must be signed in to change notification settings - Fork 143
feat: redirect after login to entrance url #789
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
Conversation
|
Thank you very much for your PR. Please note that commit writing must be with the following description: Please write unit test for PR: |
|
The |
|
@mshannaq Please do not use |
|
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 url
379a201 Merge branch 'beforeLogginUrl' of https://github.com/mshannaq/ci4-shield into beforeLogginUrl
03f3a2c feat: redirect after login to entrance url
b099984 Merge branch 'codeigniter4:develop' into beforeLogginUrl
78cac54 (upstream/develop, origin/develop, origin/HEAD, develop) Merge pull request #788 from codeigniter4/datamweb-add-status-badge
89549c3 Merge pull request #782 from kenjis/update-RELEASE.md
2d0ec09 Merge pull request #787 from datamweb/fix-style-code
27b4323 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 beforeLogginUrl
Switched to branch 'beforeLogginUrl'Do $ git rebase upstream/develop
Successfully rebased and updated refs/heads/beforeLogginUrl.$ git log --oneline
0ace028 (HEAD -> beforeLogginUrl) feat: redirect after login to entrance url
ac9173c feat: redirect after login to entrance url
97d92be Redirect after login to entrance url #722
78cac54 (upstream/develop, origin/develop, origin/HEAD, develop) Merge pull request #788 from codeigniter4/datamweb-add-status-badge |
|
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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')); |
|
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