Comments (3)
What type of authentication are you using?
from thruwaybundle.
I found the solution.
class AnnotationConfigurationPass implements CompilerPassInterface
{
......
public function process(ContainerBuilder $container)
{
......
foreach ($files as $class) {
.......
if ($class->implementsInterface('Symfony\Component\DependencyInjection\ContainerAwareInterface')) {
$container->setDefinition($serviceId, $definition)
->addMethodCall('setContainer', [new Reference('service_container')]);
} else {
$container->setDefinition($serviceId, $definition);
}
......
then I rewrite my Register code:
use Voryx\ThruwayBundle\Annotation\Register;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
class Register implements ContainerAwareInterface
{
protected $container;
public function setContainer(ContainerInterface $container = null) {
$this->container = $container;
// $user = $this->container->get('security.token_storage')->getToken()->getUser(); // It's not work and stuck here
$managerUser = $this->container->get('fos_user.user_manager');
$user = $managerUser->findUserBy(array('username'=>'ABC')); // it's work
$logger = $this->container->get('oz_base.logger');
$logger->info($user->getUsername());
}
/**
* @Register("user.line.open")
*/
public function userLineOpenAction($userID, $threadID)
{
$logger = $this->container->get('oz_base.logger');
$logger->info($userID);
$logger->info($threadID);
return "done";
from thruwaybundle.
I haven't implement authentication yet. If I use authentication, the solution will make different?
from thruwaybundle.
Related Issues (20)
- After upgrading to new release version 0.4.2 not publishing messages HOT 2
- publishing doesn't work HOT 1
- How to declare many realms or routers?
- Symfony >4 and accessing Details
- Throwing critical exception not publishing messages
- Realm "process_manager" should be private
- How to connect client manager to current user session for exclusion/eligibility handling HOT 2
- Attempted to load class "PawlTransportProvider" from namespace "Thruway\Transport". Did you forget a "use" statement for another namespace? HOT 1
- Doesn't work with symfony 3.4 HOT 5
- Problem configuring ThruwayBundle with FosUser HOT 2
- Can I stop the process manager?
- Packagist verison 1.0.x-dev is not actual. HOT 3
- Implementing authentication issue HOT 3
- Router not starting: more debug info witih -vvv HOT 2
- Example without container HOT 1
- configuring thruway to run on heroku
- Correct parameter for PawlTrasnportProvider?
- Use custom serializer to publish? HOT 2
- Setting up simple token authentication
- Publisher is not trusted HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thruwaybundle.