Skip to content

AuthenticationException #11

@andersespedalen

Description

@andersespedalen

In the browser, login works fine using the same user as in the test
Regardless of using the seeded data, or creating the user in the test, I'm getting Unauthenticated when testing Index

test

public function admin_user_can_access_nova()
    {
        $this->be(User::create([
            'name' => 'admin',
            'email' => '[email protected]',
            'password' => bcrypt('Test1234'),
        ]));

        $response = $this->novaIndex('users');
        $response->assertOk();
        $response->assertCanView();
        $response->assertCanCreate();
        $response->assertCanUpdate();
        $response->assertCanDelete();
        $response->assertCanForceDelete();
        $response->assertCanRestore();
    }

In NovaServiceProvider, even I allow all users to debug

    protected function gate()
    {
        Gate::define('viewNova', function ($user) {
            return true;
        });
    }

PHPUnit

There was 1 error:
1) Tests\Feature\NovaTest::admin_user_can_access_nova
Laravel\Nova\Exceptions\AuthenticationException: Unauthenticated.

Environment:

Homestead 10
Laravel 7
Nova 3.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions