On "Device Authorization" grant, the \League\OAuth2\Server\Repositories\DeviceCodeRepositoryInterface::persistDeviceCode() method has been used 3 times with 3 different purposes:
For persisting the new device code (when requesting a device code)
For updating the "User ID" and "User Approved" (when completing the device auth request)
For updating "Last polled at" (when responding to access token request)
This makes the implementation of this method too hard, as we have to manually determine that for which purpose this method has been called!
You may check the workaround I had to use to be able to implement this on Laravel Passport here.
On "Device Authorization" grant, the
\League\OAuth2\Server\Repositories\DeviceCodeRepositoryInterface::persistDeviceCode()
method has been used 3 times with 3 different purposes:This makes the implementation of this method too hard, as we have to manually determine that for which purpose this method has been called!
You may check the workaround I had to use to be able to implement this on Laravel Passport here.
This PR adds 2 new methods to fix this:
\League\OAuth2\Server\Repositories\DeviceCodeRepositoryInterface::persistUser()
\League\OAuth2\Server\Repositories\DeviceCodeRepositoryInterface::persistLastPolledAt()