Support the ongoing development of Laravel.io →
Authentication
Last updated 2 years ago.
0

Yes you can specify * for the origin. Otherwise you would need to know the origin of each device / network before they tried to connect.

Last updated 2 years ago.
0

You can also try https://github.com/barryvdh/laravel-cors

  • works, but not with basic auth. You can however also just return the requested host. ( $_SERVER['HTTP_ORIGIN'] or $request->headers->get('Origin') )
Last updated 2 years ago.
0

Go with barry's package because it worked wonders for me, you can also do the dirty and set your headers with PHP header in the route but I don't recommend that. Create your own auth.customname filter to do what you need to do for CORS like hashsalting, like Barryvdh said it's not going to work because it stores your session under that domain only.

Last updated 2 years ago.
0

Here's a package you can salt with, I'm kinda doing my own thing called auth.fb it's custom to auth with facebook.

http://docs.toddish.co.uk/verify-l4/

Last updated 2 years ago.
0

barryvdh said:

You can also try https://github.com/barryvdh/laravel-cors

  • works, but not with basic auth. You can however also just return the requested host. ( $_SERVER['HTTP_ORIGIN'] or $request->headers->get('Origin') )

Rock on barry, I like your solution much better and it works will with 4.1 I also found it handy because of the flexibility you added to specifically change headers based on exact paths or catch all.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

johnlamont johnlamont Joined 19 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.