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?

New member

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
Administrator

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...

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

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
Administrator

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.

New member

Posts

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

Users browsing this forum: nonnedelectari and 66 guests