-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add option for nuxtServerInit to NOT dispatch getInitialData
#214
Comments
Another (bigger) problem is, that we have to send an Authorization Header with the token to our TYPO3. But we have access to the token only on client side but the getInitialData is always called on server side. So, in our case, I think we have to avoid the server side dispatch and move it to the client (after successful log in). |
@thomasv I understand the possibility to override store logic, so I have prepared a simple PR feat: add option for disable store (#214) #216 You can disable the store and provide your own logic - I have prepared an example in the PR. Please test it, let me know if that resolves your issue. But I don't understand why you can't call Please notice also that So when you override the store logic, you have also to take care of We haven't worked with nuxt/auth yet (I have to check, can we integrate it with felogin) but currently we use |
@mercs600 Thanks you. Yes, you are right. We could configure the api response for unauthorized users, but in our architecture and use cases we do not have any dealing with non-logged-in users. So, we decided to request the typo3 backend only in logged-in status. Thanks for the PR. I think this is a good option in general to have own control. In our case, it is sufficient, if we call Right, |
@thomasv Ok I get it. We will extend store functionalities soon. |
We use nuxtjs/auth-next and our TYPO3 is only accessible for authorized users (we use oauth2 and redirect unauthorized users to an external login form).
It would be great to NOT call
getInitialData
in nuxtServerInit when users are not authorized. In this way we could detect in our application's nuxtServerInit the login state and set some flag (maybe in typo3-store or an option likegetInitialDataAutomatically
) to dispatch or not dispatch thegetInitialData
or directly dispatch the nuxtServerInit of nuxt-typo3.Would this be an idea to get nuxt-typo3 work with nuxt-auth or is there another approach?
The text was updated successfully, but these errors were encountered: