Source Code

Laravel Sanctum provides a featherweight authentication system for SPAs (single page applications), mobile applications, and simple, token based APIs. Sanctum allows each user of your application to generate multiple API tokens for their account. These tokens may be granted abilities / scopes which specify which actions the tokens are allowed to perform. (Read More)

Usage

auth: {
    strategies: {
        laravelSanctum: {
            provider: 'laravel/sanctum',
        },
    }
}
If you are utilizing laravel santum's SPA cooke authentication. then make sure to set token.type to false. By default it uses the stateless tokens.

NOTE: It is highly recommended to use proxy to avoid CORS and same-site policy issues

To login user:

const $auth = useAuth()
$auth.loginWith('laravelSanctum', {
    body: {
        email: '',
        password: ''
    }
})

๐Ÿ’ This provider is based on cookie scheme and supports all scheme options.