Post by ceebeeit » Fri Oct 04, 2019 11:16 pm

To be able to return to Opencart from an outside app I need to remember the (user_)token. Otherwise I must login again.
Used to do that in 1.5.5.1 is this way:
app.php?token=<?php echo $token; ?>

This doesn't work in 3.0.3.2. Twig refuses the php code
How should I transfer user_token now in URL?

Newbie

Posts

Joined
Fri Feb 22, 2013 8:33 pm

Post by Johnathan » Sat Oct 05, 2019 10:12 pm

If the $token variable is still set in the controller file, then you'd use this in the .twig template:

{{ token }}

You can read more about Twig syntax here:

https://twig.symfony.com/

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by xxvirusxx » Sun Oct 06, 2019 1:33 am

Or this:

Code: Select all

app.php?token={{ user_token }}
And you should specify in which file you use app.php?token=<?php echo $token; ?> on 1.5 version...

Active Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - RO

Post by Johnathan » Mon Oct 07, 2019 10:36 pm

Just to note, OpenCart 3 uses "user_token" instead, so you probably want this:

Code: Select all

user_token={{ user_token }}

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by ceebeeit » Tue Oct 08, 2019 11:00 pm

Thanks
works fine with {{ user_token }} included in URL.

Newbie

Posts

Joined
Fri Feb 22, 2013 8:33 pm
Who is online

Users browsing this forum: pson and 52 guests