Git Product home page Git Product logo

zhorton34 / authorize-slim-4 Goto Github PK

View Code? Open in Web Editor NEW
87.0 7.0 47.0 4.59 MB

Slim 4 Authorization Tutorial

Home Page: https://www.youtube.com/playlist?list=PLNuh5_K9dfQ38pmas4Y3TEEHLMRkt9qh2

License: MIT License

PHP 0.21% Shell 0.01% JavaScript 97.09% Vue 0.01% CSS 2.65% SCSS 0.01% Blade 0.04%
php slim-framework slimphp slim slimconsole vuejs vue authentication slim4 slim-micro-framework

authorize-slim-4's Issues

PHP-DI Error thrown because of RequestInput constructor

I've traced this error down to the Bootstrapper LoadDebuggingPage.php shown below (because if I comment out line 20 it will run).

10    class LoadDebuggingPage extends Bootstrapper
11    {
12        public function boot()
13        {
    ...
19            $blade = $this->app->resolve(Blade::class);
20            $input = ($this->app->resolve(RequestInput::class))->all();
21            //$input = [];

RequestInput class:

class RequestInput
{
    protected array $meta;
    protected array $attributes;

    public function __construct($request, $route)
    {
    ...

Error Thrown:

Fatal error: Uncaught DI\Definition\Exception\InvalidDefinition:
    Entry "App\Support\RequestInput" cannot be resolved: Parameter $request of __construct() has no value defined or guessable
            Full definition:  Object (
              class = App\Support\RequestInput
              lazy = false
              __construct(
                $request = #UNDEFINED#
                $route = #UNDEFINED#
              )
            )
            in app\vendor\php-di\php-di\src\Definition\Exception\InvalidDefinition.php:19
Stack trace:
#0 app\vendor\php-di\php-di\src\Definition\Resolver\ObjectCreator.php(156): DI\Definition\Exception\InvalidDefinition::create(Object(DI\Definition\ObjectDefinition), 'Entry "app\\...')
#1 app\vendor\php-di\php-di\src\Definition\Resolver\ObjectCreator.php(71): DI\Definition\Resolver\ObjectCreator->createInstance(Object(DI\Definition\ObjectDefinition), Array)
#2 app\vendor\php-di\php-di\ in app\vendor\php-di\php-di\src\Definition\Exception\InvalidDefinition.php on line 19

I assume a more recent update of PHP-DI library is the cause. Assistance would be greatly appreciated.

I've tried various imports and type hints, but not sure the solution:

use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Routing\Route;

php slim db:migration gives no error, but tables are not getting created

Hi,
The skeleton is extremely well developed, I like the structure and implementation and your explanation in the video tutorials.

But I am getting this issue.

I use PHP 8, so, I removed faker, php from the require dependencies.
I dont use homebrew.
I created a DB from mysql command.
Then after changing the env file with required db name, user, password, host as localhost (tried with 127.0.0.1 also)

php slim db:migration exectues and results is green

Screenshot 2021-10-13 at 5 22 01 PM

But php slim db:show users gives

Screenshot 2021-10-13 at 5 23 06 PM

Connection refused! not sure how!

Kindly help me with this.

Routes and methods not found

Hi
I think the only thing missing in this project are the error pages, for when the route (404) or method is not found.

Any idea?
Thanks

First `vagrant up --provision` fails

Missing PHP vendor folder on first run.

$ vagrant up --provision
Vagrant failed to initialize at a very early stage:

There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /home/X/Projects/authorize-slim-4/Vagrantfile
Line number: 0
Message: LoadError: cannot load such file -- /home/X/Projects/authorize-slim-4/vendor/laravel/homestead/scripts/homestead.rb

Does this means that I need to install PHP in the host machine to use composer, then run the development machine and then remove PHP from the host system?

Password Encryption Strategy

  • Update Password Encryption Strategy

Currently we are storing sha1 hash of the password.
Then, on login, we are comparing the hash of the submitted password with the database column.

This isn't a good idea because unsalted hashes are vulnerable to rainbow tables, and sha1 is not a good choice because it's a fast hash.

PHP has good built-in functions that handle this securely, here is some info:

https://phptherightway.com/#password_hashing https://paragonie.com/blog/2017/12/2018-guide-building-secure-php-software#secure-php-passwords

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.