jeffbeltran / sanctum-tokens Goto Github PK
View Code? Open in Web Editor NEWSimple Nova Plugin to generate a Laravel Sanctum Personal Access Token
Home Page: https://novapackages.com/packages/jeffbeltran/sanctum-tokens
Simple Nova Plugin to generate a Laravel Sanctum Personal Access Token
Home Page: https://novapackages.com/packages/jeffbeltran/sanctum-tokens
It would be great to have an option to only allow the ui to tick from a fixed list of authorisations/privileges rathe than a free type field.
it could be an optional method so the default behaviour stays as is.
would you be interested in this?
Is it possible to edit abilities after creating a token?
Hello Jeff,
Your package is great.
I would like to ask you if you can make the Abilities field on the creation form hidden and maybe with default value.
Thank you for your work,
Theofanis
Hi Jeff!
I'm Enrique and currently I'm using your package and it's very useful, thanks!. However it's necessary to be able to change language of all texts. There are some components that has hardcoded text:
So I would like to know if you can make a feature to add the internationalization?.
Thanks for your help!. I'll be waiting for your answer.
Hi,
Thanks for the package.
I get TypeError: Cannot read property 'options' of undefined
when I click on Create token in Nova.
I also use Eminiarts/Tabs if that can help.
Please advise. Thanks
Hi! thanks in advance for this cool package and for the hard work.
I've trying to use it but seems like its having some issues:
Once i'm on the User resource and after inserting
SanctumTokens::make()
When i'm on the detail page and after creating a token, nothing gets displayed while i get a js error on the console:
TypeError: Cannot read properties of undefined (reading 'length')
even when the token has been successfully created.
I'm on Laravel 8, Laravel Nova 4 and latest sanctum-tokens.
Looking forward to hear from you! Thanks again.
Hi this seems a cool little package and could be just what I need, but I am concerned that there seems to be no authorisation in place to control who can create (or indeed revoke) a token.
It looks like with a bit of messing around with the HTTP request in Nova any user could create or revoke a token for any other user.
Have I got this wrong?
Conversation here: laravel/nova-issues#6025
Hi,
All routes are defined with clousures. So, artisan optimize
or artisan route:cache
can't be executed.
What do you recommend to solve the issue? Is it something that can be improved?
Now (in ToolServiceProvider.php):
if (
$this->app->routesAreCached() ||
false === config("sanctum.routes")
) {
return;
}
Should be:
if ($this->app->routesAreCached()) {
return;
}
I'd like to be able to have the plugin routes without including Sanctum ones.
With Laravel 9, translation files are now by default located outside of the resources
directory, directly under the project root folder.
If we move the published translation file to that location, then the strings do not appear translated.
Additionally, it would be nice to publish the translation file there instead of resources/lang
.
Hey
It will be nice to have a the nova suggestion option on the tool.
This will be handy when you have a lot of abilities to choose from. The suggestion()
method leverage the native html datalist element to provide a recommended options available to choose.
Thanks for your help here and for the great package.
On Laravel Nova user resource we also see login tonkes that are generated on user login.
Is there a way to hide that? We would only like user to see tokens manually added by him.
Hi,
The token name is required, but the dialogue allows to enter the empty name.
When you enter the empty value:
Argument 1 passed to ...Models\\User::createToken() must be of the type string, null given, called in /app/vendor/jeffbeltran/sanctum-tokens/src/Http/SanctumController.php on line 27
A simple workaround is re-defining the createToken
as:
/**
* Create a new personal access token for the user.
*
* @param string $name
* @param array $abilities
* @return \Laravel\Sanctum\NewAccessToken
*/
public function createToken_d(?string $name = null, array $abilities = ['*'])
{
if (!$name) {
$name = '- Empty Name -';
}
$token = $this->tokens()->create([
'name' => $name,
'token' => hash('sha256', $plainTextToken = Str::random(40)),
'abilities' => $abilities,
]);
return new NewAccessToken($token, $token->getKey().'|'.$plainTextToken);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.