-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Update login.service.js #1285
Update login.service.js #1285
Conversation
Fixes login error with running administration watcher. If you use a different domain than "localhost" with your dev environment, the login will not work when you work in the backend with hot reload based on "bin/watch-administration.sh". This snippet is based on forum entry found here: https://forum.shopware.com/discussion/68312/admin-watch-login-geht-nicht-unter-version-6-2-0-rc1
|
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.
Please fix the lint error about self
@@ -321,9 +321,9 @@ export default function createLoginService(httpClient, context, bearerAuth = nul | |||
* @returns {CookieStorage} | |||
*/ | |||
function cookieStorageFactory() { | |||
const domain = context.host; | |||
// take current domain instead of context to enable other hosts than "localhost" | |||
const domain = window.location.hostname; |
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.
login.service.js?3aeb:324 Uncaught ReferenceError: window is not defined
at cookieStorageFactory (login.service.js?3aeb:324)
at createLoginService (login.service.js?3aeb:23)
at onMessage (admin-worker.worker.js?5b99:20)
It needs to work also without window
object
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.
Thanks for the feedback - its just a quick hack to demonstrate the problem. I don't know if its on purpose that the watcher process is restricted to "localhost" but at least for my development process, it needs to work with custom dev domains as well.
fixed the problem for me. Now I'm able to use the watcher inside a vagrant box |
This PR was closed due to inactivity. If this change is still important to you, feel free to create a new pull request. |
Fixes login error with running administration watcher. If you use a different domain than "localhost" with your dev environment, the login will not work when you work in the backend with hot reload based on "bin/watch-administration.sh". This snippet is based on forum entry found here: https://forum.shopware.com/discussion/68312/admin-watch-login-geht-nicht-unter-version-6-2-0-rc1
1. Why is this change necessary?
2. What does this change do, exactly?
3. Describe each step to reproduce the issue or behaviour.
4. Please link to the relevant issues (if any).
5. Checklist