DEV Community

StefanT123 profile picture

StefanT123

404 bio not found

Joined Joined on  github website

Education

Faculty of Mechanical Engineering

Work

Full-stack web developer

All 67 comments

PKCE authenticaton for Nuxt SPA with Laravel as backend

the login flow is the same for every user

PKCE authenticaton for Nuxt SPA with Laravel as backend

no, you will need just one client

PKCE authenticaton for Nuxt SPA with Laravel as backend

you can put any id there

PKCE authenticaton for Nuxt SPA with Laravel as backend

I assume that you are talking about client_id? Or am I wrong?

How to get time spent by users on a webpage using Node.js?

Couldn't you just saved the time when the user opened the pag...

PKCE authenticaton for Nuxt SPA with Laravel as backend

TBH I don't know really, but I guess you could do something l...

PKCE authenticaton for Nuxt SPA with Laravel as backend

Maybe you should try to revoke the token and clear the users ...

PKCE authenticaton for Nuxt SPA with Laravel as backend

How do you revoke the token?

Different ways to authenticate your APIs

Just one small clarification, the OAuth framework is for auth...

Secure authentication in Nuxt SPA with Laravel as back-end

As the refresh_token is set to be HttpOnly cookie, you can't ...

Secure authentication in Nuxt SPA with Laravel as back-end

Once a user has logged in, you should put user_id in the cook...

PKCE authenticaton for Nuxt SPA with Laravel as backend

On page reload, check for the token in cookies, and if there ...

Secure authentication in Nuxt SPA with Laravel as back-end

No, your apps can be on different domains, and this would sti...

Secure authentication in Nuxt SPA with Laravel as back-end

When your access_token has expired (because it's short-lived)...

PKCE authenticaton for Nuxt SPA with Laravel as backend

Just get the users token and delete it. Auth::user()->toke...

PKCE authenticaton for Nuxt SPA with Laravel as backend

You can, but I haven't used it yet. I think it's not as flexi...

Secure authentication in Nuxt SPA with Laravel as back-end

The flow will be more or less the same

PKCE authenticaton for Nuxt SPA with Laravel as backend

Read the documentation for fruitcake/laravel-cors

PKCE authenticaton for Nuxt SPA with Laravel as backend

See if the post request has been enabled for CORS

PKCE authenticaton for Nuxt SPA with Laravel as backend

You need to setup the correct domain for the CORS

PKCE authenticaton for Nuxt SPA with Laravel as backend

You should do something like this this.$axios.setToken(access...

PKCE authenticaton for Nuxt SPA with Laravel as backend

You need to send Bearer header with every request

PKCE authenticaton for Nuxt SPA with Laravel as backend

If you are using laravel version 6.x, then you should add COR...

PKCE authenticaton for Nuxt SPA with Laravel as backend

We are using Passport Grant Token

PKCE authenticaton for Nuxt SPA with Laravel as backend

You must be logged in the backend if you want to make a reque...

PKCE authenticaton for Nuxt SPA with Laravel as backend

What you did here is almost the same as if you have done it c...

PKCE authenticaton for Nuxt SPA with Laravel as backend

Well, if you've set up your back-end properly, they won't be ...

PKCE authenticaton for Nuxt SPA with Laravel as backend

You can use the cookies to persist the state or use some pack...

PKCE authenticaton for Nuxt SPA with Laravel as backend

No, they are not deleted automatically

PKCE authenticaton for Nuxt SPA with Laravel as backend

I think yes, or I still haven't found any better way to do it.

PKCE authenticaton for Nuxt SPA with Laravel as backend

You should check if the token exists in the cookies or in the...

Secure authentication in Nuxt SPA with Laravel as back-end

I didn't quite understand your question. Can you explain it a...

PKCE authenticaton for Nuxt SPA with Laravel as backend

If your both applications are on the same top-level domain, y...

Secure authentication in Nuxt SPA with Laravel as back-end

Thank you, and you are right, it should be auth.js. I'll chan...

Secure authentication in Nuxt SPA with Laravel as back-end

Because we don't want our Passport client_secret exposed, s...

Secure authentication in Nuxt SPA with Laravel as back-end

I'm glad it helped you :)

Secure authentication in Nuxt SPA with Laravel as back-end

You're doing something wrong

PKCE authenticaton for Nuxt SPA with Laravel as backend

Yes, the part with decreasing the refresh_token expiration ...

Secure authentication in Nuxt SPA with Laravel as back-end

Yes, but I don't want to use it, because it's not flexible ...

PKCE authenticaton for Nuxt SPA with Laravel as backend

I'm always storing my short-lived access_token in the cook...

Secure authentication in Nuxt SPA with Laravel as back-end

I never tested it like that, but I use SSR only for SEO opt...

Secure authentication in Nuxt SPA with Laravel as back-end

Yes, I haven't covered that in this post, but I have posted...

Secure authentication in Nuxt SPA with Laravel as back-end

Here you go, a post for PKCE autheticaiton

Secure authentication in Nuxt SPA with Laravel as back-end

It's not a third-party plugin, it's just a custom nuxt plug...

Secure authentication in Nuxt SPA with Laravel as back-end

I don't think this is the best solution, but it might work ...

Secure authentication in Nuxt SPA with Laravel as back-end

It's not flexible enough for my needs...

Secure authentication in Nuxt SPA with Laravel as back-end

Yes, I mention that in the post, I guess you missed that pa...

npm vs npx - which to use when?

Just to note that since npm version 5.2.0 npx is pre-bundle...

Secure authentication in Nuxt SPA with Laravel as back-end

I'm not sure if that requires whole new post, but maybe I'll ...

Secure authentication in Nuxt SPA with Laravel as back-end

I would just directly return the user from the login route ...

Secure authentication in Nuxt SPA with Laravel as back-end

Never save the token in the local storage, if you do, you a...

7 JavaScript data structures you must know

I think you are missing the stack data structure in the tex...

Secure authentication in Nuxt SPA with Laravel as back-end

I can't help you unless I see your code :( However, you ca...

Secure authentication in Nuxt SPA with Laravel as back-end

Hmm, if the refresh_token is in the Request Cookies, it sho...

Secure authentication in Nuxt SPA with Laravel as back-end

You shouldn't store the refresh_token anywhere, it should b...

Secure authentication in Nuxt SPA with Laravel as back-end

Changed the refreshTo into refreshToken I saw that you've...

Secure authentication in Nuxt SPA with Laravel as back-end

Thanks. Yes, it works well, you just need to check for the ...

Secure authentication in Nuxt SPA with Laravel as back-end

Thanks for the comment. To be honest, I wasn't aware that t...

An Adequate Introduction to Functional Programming

Objects and arrays are passed by reference in JS, that is,...

My Personal Git Tricks Cheatsheet

Quick amend git commit --amend --reuse-message HEAD My a...

What are your worst coding habits?

Two things: I Always try to reinvent the wheel. It's very...

Solving Puzzles With High-Performance JavaScript

I did, long time ago and it was forgotten until I saw this ...

Solving Puzzles With High-Performance JavaScript

I think it does.

Solving Puzzles With High-Performance JavaScript

Hmm, I've run some benchmark tests (I ran them online on Ch...

Solving Puzzles With High-Performance JavaScript

For the fibonacci puzzle, here is a solution that runs in a...

What are your five most used terminal commands?

New machine, but actually I'm very surprised with these. ...

Lets Build Web Components! Part 1: The Standards

One of the best posts I've read. Very well explained. It wi...

loading...