-
Notifications
You must be signed in to change notification settings - Fork 0
Add alias for the Guard contract to auth.driver #2
Conversation
The current controllers use |
Odd. It's injected elsewhere, but it looks like most are just injecting The method for extending |
@JN-Jones Where is this contract bound into the container? https://github.com/mybb/mybb2/blob/master/app/Http/Controllers/Controller.php#L7 I couldn't find anywhere that it bound that contract to a concretion. |
It doesn't use the contract somewhere else. It uses laravels guard implementation instead. Which resolves to ours as laravels isn't initialed at all. |
If this fixes the issue though, we should merge it. That contract is bound through other contracts (the |
So we should be type-hinting for |
Yep. Also we should suggest to laravel to make extending easier. Extending three classes just to change the hashing algorithm is pretty stupid. |
If this commit fixes that and allows using the contract it should be changed |
IMO we should type hint |
Agree with @euantorano. The hashing algorithm we're using instead is still bcrypt right? Or rather, something much much better than md5 or sha* ? |
Yes, we use BCrypt by default. The alternative hashing algorithms are meant to enable support for the future merge system as other boards use other hashing mechanisms. This package allows those mechanisms to still function after a merge without forcing password resets for all users. |
By default we're using bcrypt (laravels default class). However we also support different ones like mybb 1.x, phpbb, phpass etc. Everything the merge system may need |
EG: Support for old MyBB 1.x passwords so that upgraded boards don't require 100% password resets for all users. |
I see. Good chat. If we could merge this that would be great 👍 We should also try and enforce hinting on our own contract rather than the Illuminate one. |
Yep, should be changed everywhere (only online from mobile so can't merge/test anything) |
Can we merge this @euantorano @JN-Jones ? |
Nothing against it - can you also change the controllers then? |
Sure, I'll do it once this is merged 👍 |
Add alias for the Guard contract to auth.driver
@euantorano @JN-Jones when I created a new controller, I got a "Mybb\Auth\Contracts\Guard is not instantiable" exception from the container when it was trying to resolve
MyBB\Core\Http\Controllers\Controller
, this fixed it.Did either of you have a similar problem at any stage? I can't really see how it ever would have worked?