yaroslawww / nova-external-login
Laravel Nova resource tool that allows a user or other resource to log into an external control panel or application.
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/yaroslawww/nova-external-login
Requires
- php: >7.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
This package is auto-updated.
Last update: 2025-11-29 03:31:43 UTC
README
Laravel Nova resource tool that allows a user or other resource to log into an external control panel or application.
Installation
composer require yaroslawww/nova-external-login
Usage
Nova Part
ExternalLogin::make()
->setUniqueKey('ads-dashboard') // in case if you want add two different logins to same resource
->buttonTitle('Login to SPA')
->iframePath('/login-as')
->redirectPath('/home')
->postUrl('https://spa.mydomain.com')
->loginUsing(function (NovaRequest $request) {
return Response::json([
'data' => [
'access_token' => thereFunctionWillGenerateAndReturnToken($request),
// other params if need
]
], 201);
}),
SPA part
File should contain js something like this
export default Vue.extend({ // ... created() { window.addEventListener('message', (event) => { if (event.origin === this.$config.adminURL) { if (event.data && event.data.access_token) { this.$store.dispatch('auth/setToken', event.data.access_token) setTimeout(() => { this.$store .dispatch('auth/getProfile') .then((response) => { console.warn(response) // Some data }) .catch((error) => console.error(error)) }, 0) } } }) }, // ... })
