I was able to reproduce this issue on a fresh Drupal + XB install.
Drupal\Core\Render\Component\Exception\InvalidComponentException: [image.src] Invalid URL format in Drupal\Core\Theme\Component\ComponentValidator->validateProps() (line 203 of /var/www/html/core/lib/Drupal/Core/Theme/Component/ComponentValidator.php).\
Kristen Pol โ credited Ruturaj Chaubey โ .
The back-end code looks something like this
public function success(Request $request) {
$authHeader = $request->headers->get('Authorization');
if ($authHeader && preg_match('/Bearer\s(\S+)/', $authHeader, $matches)) {
$jwt = $matches[1];
try {
$decoded = JWT::decode($jwt, 'dummy-jwt-secret');
// Assuming the payload has a userId.
$uid = $decoded->userId;
$user = User::load($uid);
if ($user) {
return new JsonResponse([
'status' => 'success',
'user' => [
'uid' => $user->id(),
'name' => $user->getUsername(),
],
]);
}
} catch (\Exception $e) {
$this->logger->error('JWT validation failed: @message', ['@message' => $e->getMessage()]);
return new JsonResponse(['status' => 'error', 'message' => 'Invalid JWT token'], 401);
}
}
$data = [
'status' => 'success',
'message' => 'The request was successful.',
'value' => $authHeader
];
return new JsonResponse($data);
}
@brianperry
The example you shared in #5 โ looks pretty solid.
For the second scenario, I was able to issue a JWT from a JS app and send it to the Drupal back-end.
On Drupal front, I tried to consume the token using a custom controller but its still in progress.
Is this the kind of strategy we want to use in this case?
rahul.shinde โ credited Ruturaj Chaubey โ .
Ruturaj Chaubey โ made their first commit to this issueโs fork.
Ruturaj Chaubey โ made their first commit to this issueโs fork.
Ruturaj Chaubey โ made their first commit to this issueโs fork.
Ruturaj Chaubey โ made their first commit to this issueโs fork.
Ruturaj Chaubey โ made their first commit to this issueโs fork.
Ruturaj Chaubey โ made their first commit to this issueโs fork.
nod_ โ credited Ruturaj Chaubey โ .
Ruturaj Chaubey โ made their first commit to this issueโs fork.
Ruturaj Chaubey โ made their first commit to this issueโs fork.
Converted ViewsDisplayExtender
plugin discovery to PHP attributes.
@larowlan is the approach of conversion correct ?
Ruturaj Chaubey โ made their first commit to this issueโs fork.
Added the OVERRIDDEN
highlight on the custom theme templates that override the core template.
Ruturaj Chaubey โ made their first commit to this issueโs fork.
Ruturaj Chaubey โ created an issue.
Ruturaj Chaubey โ made their first commit to this issueโs fork.
Ruturaj Chaubey โ made their first commit to this issueโs fork.
Ruturaj Chaubey โ made their first commit to this issueโs fork.
Ruturaj Chaubey
- Registration booth.
- Made goodie bags and gave out welcome kits.
@andrimont The issue is not reproducible. Although I do get this error when I try to install the module on my Drupal instance (Refer screenshot).
lauriii โ credited Ruturaj Chaubey โ .