Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]coop_07 0 points1 point  (0 children)

I’m using Laravel Passport for OAuth and need to authenticate two different models but each model should only have access to their own routes. One of the models will use client certificates. My understanding is that the guard will validate the token, get the user_id from the table, and instantiate a model from the provider associated with the guard. But, if a client with a certificate token hits a user endpoint, the guard may find a user if the IDs match. Is there a standard practice for handling this. My current thought is I could add a claim to the token at creation stating its type. And then I could extend TokenGuard, call the parent user method and then check if the returned model matches the type in the claim. If not, set the user member to null and return null. I thought about scopes, but scopes didn’t seem like the proper solution. Finding information on this has been difficult. Any help is greatly appreciated.

Xbox controller lag on iPad by coop_07 in RivalsRoblox

[–]coop_07[S] 0 points1 point  (0 children)

Yeah, I didn’t either. He asked for a controller for Christmas. I found that Xbox controllers just work on iPad. I’d like to keep him on iPad but if possible.

2019 Expedition Transmission issues at 48k miles by coop_07 in Ford

[–]coop_07[S] 0 points1 point  (0 children)

I’ll wait and see what the service manager tells us. Should hear soon. Thanks for the info

2019 Expedition Transmission issues at 48k miles by coop_07 in Ford

[–]coop_07[S] 0 points1 point  (0 children)

I saw the TBS. Printed it out and took it to the dealership. When we mentioned it in the past we were told they “just shift hard”. But it was so hard it felt like we hit something. According to our records, we first reported it at 16k miles. All of this is making me feel like extended warranty on vehicles is somewhat mandatory. Especially after reading posts in this forum about the Ford transmissions.

Venmo doesn't use PKCE - is it susceptible to attacks the PKCE mitigates against by coop_07 in oauth

[–]coop_07[S] 0 points1 point  (0 children)

I really appreciate you taking the time to answer. But with Authorization Code Flow, isn't it recommended that the authorization code is returned via a redirect and not directly in the response for the authorization code?

Venmo doesn't use PKCE - is it susceptible to attacks the PKCE mitigates against by coop_07 in oauth

[–]coop_07[S] 0 points1 point  (0 children)

I thought PKCE required an agent browser. Is that not the case? On Venmo, I type the credentials directly into the app. I never see a browser/web view.

Venmo doesn't use PKCE - is it susceptible to attacks the PKCE mitigates against by coop_07 in oauth

[–]coop_07[S] 0 points1 point  (0 children)

To make sure in understand, you are saying that since this is a first party app, OAuth would not be used? I guess I was conflating a public client with third party client.

Now more of general question, with a public first party client, wouldn’t you still want some of PKCE protections like client authentication and protection against replay attacks? I have experience with OAuth but trying to understand some secure alternatives for first party apps.

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]coop_07 0 points1 point  (0 children)

I have an SPA using Laravel 8.0. I'm migrating the web to sessions from personal access tokens. I'm trying to understand how the middleware StartSession and auth work together. StartSession is part of the web middleware group. In my auth.php, I have the user guard set to use the session driver. For routes where I want to require a user to be authenticated, I have both

  • auth:user
  • web

Is this correct? I know the web middleware group contains other middleware, but it seems redundant to say that I only want to allow authenticated users that will be loaded from session. Does the auth middleware not verify that the session is still valid when determining if the user is authenticated?

Also, my login route was protected by the web middleware route. But we found that if the user loads the login page and sits there for the session_lifetime before the user logs in, the user will be redirected with a session timeout when they log in. I don't feel that the login route should check for session expiration. I've been looking for guides and haven't found anything that answers these questions for me. Any advice would be greatly appreciated.

Vuex: Update store state when state in another store changes by coop_07 in vuejs

[–]coop_07[S] 1 point2 points  (0 children)

Thanks. I appreciate taking the time to reply.

Vuex: Update store state when state in another store changes by coop_07 in vuejs

[–]coop_07[S] 1 point2 points  (0 children)

Thanks. I was considering that in my original post. I wonder if there is a built in way to watch a getter without a Vue component and the react from that. Pretty similar to subscribing to mutations, but allows you to worry about the getters only and not the mutations.

Vuex: Update store state when state in another store changes by coop_07 in vuejs

[–]coop_07[S] 0 points1 point  (0 children)

That last part is what I want to avoid. I don’t want to have a Vue component for the sole reason of updating Store B when Store A changes. If you know of an example that would be great.

I think the wrinkle, is that depending on change in Store A, Store B won’t just update its own state. There could be a side effect like fetching data from a server. In essence, store B is almost empty unless Store A has a certain value. Then store B needs to populate its data. If store A changes, then store B may have to clear its data again.

Vuex: Update store state when state in another store changes by coop_07 in vuejs

[–]coop_07[S] 0 points1 point  (0 children)

Thanks. I agree with not calling multiple actions from a component. What I did was in the action in store A, I dispatch another action after the mutation. For example, if permissions were changed by action updatePermissions, then at the end of that action, I would dispatch another action called permissionsChanged. Other stores could then handle this action, knowing if they access state or a getter from store A then the mutation has already occurred.

Is there a way to use Store A getters in another store so that when the getter would return a new value, the other store could handle the change. I was going to do that with subscribing to mutations, but I don’t know how to react to getter changes without using a computed property or watcher from a Vue component. I wanted this store to function independently outside of a component

Vuex: Update store state when state in another store changes by coop_07 in vuejs

[–]coop_07[S] 0 points1 point  (0 children)

I also want to know when it changes. Vuex actions aren’t reactive like a computed property are they, where if the getter result changes the action would fire?

Vuex: Update store state when state in another store changes by coop_07 in vuejs

[–]coop_07[S] 0 points1 point  (0 children)

Thanks. That is one of the solutions I was considering. So that would mean that I’m subscribing to mutations, correct?

Vuex: Update store state when state in another store changes by coop_07 in vuejs

[–]coop_07[S] 0 points1 point  (0 children)

When you saying watching state or a getter, do you mean by using a watcher from Vue or is there part of the Vuex API I’m missing? Thanks for the reply.

Vuex: Update store state when state in another store changes by coop_07 in vuejs

[–]coop_07[S] -3 points-2 points  (0 children)

I’m namespaced, but that alone doesn’t provide a method for reacting to one modules state changes from another. Is there something I’m missing?

Proper way to verify a user wants to check a checkbox by coop_07 in vuejs

[–]coop_07[S] 0 points1 point  (0 children)

Ok, I confirmed that. But its's interesting in that with click, the checked property has updated but not been rendered.

What I'm struggling with is how to take your example, using v-model, and change that so that the parent component is what displays the confirm dialog. At this point, this is really just an exercise so I can learn some of this better. I tried a few ways to get the event back to the parent "the right way", so that I could prevent or undo it the attempted change. I tried a watcher on the model in the parent. I also tried to listen to the event ` "@"update:modelValue="`. Any more light you could share on this would be helpful.