Hello, did you find the way of doing this i want to do the same thing in
react native
On Tuesday, March 14, 2017 at 12:06:31 AM UTC+2, Mika Sjöman wrote:
>
> Hi
>
> After extensive searching in the forum, docs and the internet, I feel that
> I can post the question here. I am building a React Native application,
> which means I don't have access to localstorage (this is not a web-app) - I
> think that I need to save some kind of login token in my React native state
> variable and re-send it for every request (being my best guess). Other
> implementations I found on the forum uses web-implementations with Angular,
> but since this is not a web-page, I need to handle this using just JS.
>
> I wonder if anyone here has experience of doing something similar? Is it
> possible to use a POST request using say axios to do something like this
> towards the login/register:
>
> axios.post('myWeb2pyBackend/myapp/user', { username: 'myloginname',
> password: 'test2' }) .then(function (response) { console.log(response);
> // if OK, save some token to state and resend with every GET request later
> }) .catch(function (error) { console.log(error); });
>
> Observe that this is Node.js that doesn't have access to the browser
> window variable or any other browser specific thing like localstorage.
> Would it be possible to get a JSON web token as a response from web2py that
> I resend to the server when the user asks for other resources which
> requires a signed in user?
>
> Cheers
>
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.