0

I'm fairly new to nativescript-vue dev and I'd like to set authentication for my native app, I have been thinking about using firebase auth but I'd rather go the laravel route (if it's a good choice at all).

How I think I'd handle this is to send a post request to my backend (which is a laravel app) into my custom auth controller, then in the success callback I'd change isLogged in the vuex store to true or false, since I'm suing also vuex-persistedstate to persist some data into my localStorage (actually it's Application Settings in natviescript afaik).

Is my way of doing this okk? has anyone done it?

1
  • Your backend code is completely your choice, in {N} or any mobile app anything from app to server is just a Http call. And Yes, you may store auth tokens in local storage (application settings). Commented Dec 4, 2019 at 3:28

1 Answer 1

1

I was using a Laravel API before, but decided to switch back to Firebase, I think it’s a better choice for mobile.

But if you want to use Laravel, take a look at Laravel Passport (https://laravel.com/docs/6.x/passport).

You can use the Password Grant (https://laravel.com/docs/6.x/passport#password-grant-tokens) to generate a token from your mobile application, by creating a login endpoint that will generate the token for you.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.