On laravel 6, my redirection works well
return redirect()->route('name');
The behavior is what I expected, but on laravel 7, the same code does not do the same thing.
Instead of having the redirection, I get a blank page with my url printed on it.
I have tried many ways by reading the Laravel 7 redirection doc (and also here, 2 topics about laravel 7 redirection), but always this blank page + the supposed redirect url, printed on it.
Thank you for reading and suggestion/help
#kerbholz yes, you are right and thank your for your reply.
I found why... I have this simple instruction before,
return route('name');
And it did an implicite redirection on laraval 6 but no more on laravel 7, that's why I have a blank page, with the url printed on it;
Because the previous instruction returns only a string and nothing more...
Thank you
Related
On our server-side authentication with Facebook we get a random and weird issue. Facebook calls the call back URL two times with the same code. This is only happening for some users and not on every login.
This is the flow we have implemented on our side: https://developers.facebook.com/…/manually-build-a-login-fl… . We have been using it since the beginning of 2013 and we haven't noticed any issues so far.
And this is the error we get when we are exchanging the code for an access token the second time.
{"error":{"message":"This authorization code has been used.","type":"OAuthException","code":100,"fbtrace_id":"traceID"}}
We tried to log this issue as a bug on https://developers.facebook.com/bugs but unfortunately it doesn't work.
It keeps showing unexpected error. Not to mention that i was unable to find the correct bug category.
Any idea on how we can fix this?
Thanks!
Could it be that users are clicking twice to process auth service? Try disabling the button before calling Facebook auth service
What language are you using?
I just had this problem in Ruby using Devise for Rails. I had created an omniauth.rb initializer file, and added a config line item in the devise.rb initializer file.
If you did this too, you can remove the omniauth.rb initializer file and you should be good to go!
My client moved a Zend application from another server and it has 2 errors in new server.
Error 1 - The login screen is loaded with below notice error.
Notice: Array to string conversion in /home/padcoser/public_html/Zend/Db/Adapter/Pdo/Abstract.php on line 75
Error 2 - Adter login it shows redirection error.
exception 'Zend_Controller_Response_Exception' with message 'Cannot send headers; headers already sent in /home/appdirectory/public_html/Zend/Db/Adapter/Pdo/Abstract.php, line 75' in /home/appdirectory/public_html/Zend/Controller/Response/Abstract.php:323
When I checked with forum, they suggest to remove unwanted lines in php file after closing PHP tag. But it does not fix.
Please let me know your comments.
As per Tim's comments, I fixed the error #1 by downgrading the PHP version 5.4 to 5.3 and it is working fine now.
Thanks for all your comments.
I have a jquery mobile site that I want to share via facebook's dialog/feed system.
jQuery mobile uses #'s for their internal navigation system, so if I want to share a jqm url for page_3 of my jqm site, I would use something like: http://www.my_jqm_site.com/#page_3.
But that # is causing grief for facebook's dialog/feed:
https://www.facebook.com/dialog/feed
?app_id = ...
&link = http://apps.facebook.com/celjska_puzzle/#page_3
&redirect_uri = http://apps.facebook.com/celjska_puzzle/#page_3
&picture = ...
&name = .
&caption = ...
&description = ...
So is their anyway to do it?
I have tried it both with and without encoding.
Currently I suppose I will use a ? and then get the page to make some alterations via javascript during loading, but I really hate the thought of doing it this way.
I'm working on a problem like this right now. The URL to go in redirect_uri and link:
.../xfile.jsp?item=/contests/bhg_homeimprovement/bhg_splashsweeps_win2500_homeimprovement&temp=yes&hid=#HashID#&esrc=nwbhgsweeps072514a
The FB dialog gets an error as is. Encoding the full URL fixes that and does output hashes around "HashID", but the equal sign before it is removed. Adding a 2nd equal sign there will output 2 equal signs, but having just one will output none.
This isn't a complete solution but it does look like hash marks are possible.
In some circumstances, I have to pass a request to a Wicket page to another Wicket page on the server side, i.e. forward maintaining the URL in the browser address bar, but passing the page parameters to the second page.
Before Wicket 1.5, I could do
public MyPage(PageParameters params) {
// some logic here to decide whether and where to forward
setRedirect(false);
setResponsePage(MyOtherPage.class, params);
}
As setRedirect(boolean) no longer exists, is there a way to achieve a server-side forward in later Wicket versions?
A colleague just found the solution here:
http://mail-archives.apache.org/mod_mbox/wicket-users/201203.mbox/%3CCAMomwMr2fkO38E3d9RTk5TEmuf0Vx66F46F8eYs84Bb3bVtPgA#mail.gmail.com%3E
Now it is:
RequestCycle.get().scheduleRequestHandlerAfterCurrent(new RenderPageRequestHandler(new PageProvider(MyOtherPage.class, params), RenderPageRequestHandler.RedirectPolicy.NEVER_REDIRECT));
Scary piece of code... does not look elegant at all, but works.
On Wicket 6 you can redirect to another page in a simpler way, throwing RestartResponseAtInterceptPageException at any point in your page code:
throw new RestartResponseAtInterceptPageException(WicketPage.class)
It worked fine for me...
You should be able to simply do:
throw new RestartResponseException(MyOtherPage.class, params);
In Drupal 7, some of (non-existing) URLs are not redirecting to 404 or any error page it should. Instead, it still remains showing its Top Parent Folder. For example like:
www.mywebsite.com/items/aaaaaaaaaaaaa
www.mywebsite.com/items/bbbbbbbbbbbbbbbbbb
Every WRONG URLs under /items/ i put like above, are showing the Page of its parent:
www.mywebsite.com/items instead of get redirected to 404
I don't want its parent to be shown if there is no page really.
But the strange thing is, it is NOT happening on every patterns. I mean, another different parents like:
www.mywebsite.com/users/aaaaaaaaaaaaa
www.mywebsite.com/users/bbbbbbbbbbbbbbbbb
For the wrong url typed-in under this /users/ parent path, it is CORRECTLY redirecting to the 404 page.
What is it please?
If I understand your question correctly, it's not a problem at all.
That's because how your/contributed/core modules hooks Drupal menu system.
If a menu item (menu router item to be specific. Think about a path like "admin/config/development/performance") has no "%" sign in it, menu callback function will be executed.
For an example, if a module registers "items" path example.com/items path would not be a 404, and the appropriate menu callback function of the menu item will be fired. That callback function can make use of further URL parts (example.com/items/123) if given.
'node' is a good example. (technically they are different menu router items though) .
Opening example.com/node will not fire a 404.
If a module registers 'items/%' , then, example.com/items will fire a 404. In other words, the second URL part is required in order to execute the menu callback function.
If the problem you are facing is related to a custom module, make sure you register the correct version of your router items. If the second URL part is required, register items/%.
You can execute a 404 by calling drupal_not_found().
Look at this, really helpfull
http://peterpetrik.com/blog/2009/11/non-existent-urls-views-2
Are you using Views for that path (/items)?
Here is an issue for Views: Prevent duplicate content (because Views returns 200 instead of 400 404)
You could create a Contextual filter to prevent this.
merlinofchaos wrote:
If you don't want this behavior, add the Global: NULL argument to Views and use the setting to validate that the argument is empty.
For Drupal 6, the module Views 404 might help.
You can configure your drupal installation to redirect to a specefic 404 page that you create..
Go to www.yoursite.com/admin/config/system/site-information and enter your 404 page .