@action('index')
@action.uses(auth.user)
def index():
return {"ok":1}Here @action.uses(auth.user) tells py4web that this action requires a logged in user and should redirect to login if no user is logged in.
this redirect is good for an full web2py app.
What if i have a SPA in vue ?
In case the user is not logged it it should not redirect to login page because the apps is a outsider vue spa. How to return an error to vue spa ??
regards
António

It seems it depends on request.content_type
https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/9608a9ab-d338-4580-9d02-31b9b9a30782%40googlegroups.com.
getting this from py4web as an api.Is not what i would like to see from a SPA standpoint.RegardsAntónio
Em qui., 20 de fev. de 2020 às 18:03, Val K <valq...@gmail.com> escreveu:
It seems it depends on request.content_type
https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/77ac539d-a83e-4931-ae79-424c3a4711fd%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/77ac539d-a83e-4931-ae79-424c3a4711fd%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/1e3387f6-bf14-406f-9c6b-306a06630961%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAKk5xSzm%3DeCCd24Z0ZXF%3DtikA5Z_GXUet1SDGeEMPGVH%3DdRt1A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CADHCKLSoHnK-20XDA29kQr8MEN%2BLUHh-uw%2BaMu64443GiRi2KA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAKk5xSzOTA%2Bnu7PVZhRttEGmfA6h2KTV9evWn30FWXbLA9POMw%40mail.gmail.com.
| Powered by cloudHQ |
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAAE8D_CRcCq0vEHwr346pKBEVS43Ys03NMPNDo5QBk7efZiDkQ%40mail.gmail.com.