Welcome Guest, Not a member yet? Register   Sign In
myth/auth service not working and return null
#1

(This post was last modified: 08-26-2021, 01:34 AM by takbitdev.)

Hello everyone
Myth/auth
Auth\Controllers\AuthController.php : ~ 29
$this->config = config('Auth');
$this->auth = service('authentication');

if ($this->auth->check()) : ~ 46

This two lines return null and this error message: Call to a member function check() on null
Reply
#2

(This post was last modified: 08-27-2021, 01:33 AM by takbitdev.)

Solved.
In Linux system, paths must contain / but my local machine have Windows and in windows system paths have \ .
Just modify the psr4 paths:

In Windows server:

public $psr4 = [
APP_NAMESPACE => APPPATH, // For custom app namespace
'App'        => APPPATH, // To ensure filters, etc still found,
'Config'      => APPPATH .'Config',
'Addon'      => ROOTPATH .'addon',
'Blog'        => ROOTPATH .'addon\Blog',
'Auth'    => ROOTPATH .'addon\Auth'
];

In Linux server:

public $psr4 = [
APP_NAMESPACE => APPPATH, // For custom app namespace
'App'        => APPPATH, // To ensure filters, etc still found,
'Config'      => APPPATH .'Config',
'Addon'      => ROOTPATH .'addon',
'Blog'        => ROOTPATH .'addon/Blog',
'Auth'    => ROOTPATH .'addon/Auth'
];
Reply
#3

you can use the DIRECTORY_SEPARATOR constant instead of changing it manually in between servers
Reply




Theme © iAndrew 2016 - Forum software by © MyBB