update: support md5 with sha256

This commit is contained in:
tokumeikoi 2021-09-14 02:38:24 +09:00
parent a365357770
commit ec00fc4496
2 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,7 @@ class Kernel extends HttpKernel
\Illuminate\View\Middleware\ShareErrorsFromSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class, \App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class, \Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\CORS::class,
], ],
'api' => [ 'api' => [

View File

@ -69,6 +69,7 @@ class Helper
switch($algo) { switch($algo) {
case 'md5': return md5($password) === $hash; case 'md5': return md5($password) === $hash;
case 'sha256': return hash('sha256', $password) === $hash; case 'sha256': return hash('sha256', $password) === $hash;
case 'mws': return md5(hash('sha256', $password)) === $hash;
default: return password_verify($password, $hash); default: return password_verify($password, $hash);
} }
} }