yiisoft / auth Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://www.yiiframework.com/
License: BSD 3-Clause "New" or "Revised" License
Home Page: https://www.yiiframework.com/
License: BSD 3-Clause "New" or "Revised" License
During development authKey concept was moved to yiisoft/user package because it was used for "remember me" cookie only. It should be back and should be checked when restoring current user from session/cookie. That is because on password change or similarly important action we should invalidate:
Do we need to add such a check and throw exception if pattern empty?
Decouple IdentityRepositoryInterface::findIdentityByToken
to separate interface for yiisoft/user#3
I think the IdentityWithTokenRepositoryInterface
should not extend the IdentityRepositoryInterface
.
Because each Identity in this repositori can be related with multiple tokens.
Should we add the interface of service for a Identity Token invalidation?
Invalidated can be one token (by token and token type) or all user tokens (by identity id and optional token type)
Group::create("/products")
->withCors(Cors::class)
->routes()
->routes(
Route::get('')
->action([ProductController::class, 'index'])
->name('product/index'),
Route::get('/{id:\d+}')
->middleware(Authentication::class)
->action([ProductController::class, 'view'])
->name('product/view'),
Route::post('')
->middleware(Authentication::class)
->action([ProductController::class, 'create'])
->name('product/create'),
Route::post('/{id:\d+}')
->middleware(Authentication::class)
->action([ProductController::class, 'update'])
->name('product/update'),
Route::delete('/{id:\d+}')
->middleware(Authentication::class)
->action([ProductController::class, 'delete'])
->name('product/delete'),
Route::put('/{id:\d+}/undo')
->middleware(Authentication::class)
->action([ProductController::class, 'undo'])
->name('product/undo'),
Route::post('/{id:\d+}/favorite')
->middleware(Authentication::class)
->action([ProductController::class, 'favorite'])
->name('product/favorite'),
Route::delete('/{id:\d+}/favorite')
->middleware(Authentication::class)
->action([ProductController::class, 'cancelFavorite'])
->name('product/cancelFavorite'),
),
like product/view if user is login will return 'favorite': true, if not login will return 'favorite': false
but if is use Authentication middleware, must login.
is can use follow code
Authentication::class => [
'class' => Authentication::class,
'__construct()' => [
'authenticationFailureHandler' => Reference::to(PassportRequestErrorHandler::class),
],
'withOptionalPatterns()' => [
'optional' => ['/en/products/[1-9]']
]
],
but delete,update action url is like to view.
what can i do?
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.