Commit fb91dabf authored by Francois Gannaz's avatar Francois Gannaz
Browse files

user.getReportTokenForRedirect()

parent 5cd0b0a5
......@@ -121,6 +121,20 @@ class user extends moodlefetcher
}).then(x => x.data)';
}
/**
* Return a JWT token for the redirection page of LnB, so that the user ends on the report page.
*
* @param int $teamconfigId
* @return string JWT
* @throws \moodle_exception
*/
public function getReportTokenForRedirect(int $teamconfigId) : string {
$payload = [
'path' => "/report/enter/$teamconfigId",
];
return $this->fetcher->encodeJwtToken('/v1/redirect', $payload);
}
/**
* Return a JWT token for the redirection page of LnB, so that the user ends on the teaming page.
*
......
......@@ -8,6 +8,8 @@
namespace mod_labnbook\local;
use mod_labnbook\fetch;
class helper
{
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment