Is there a way to send a user straight to signup using the laravel sdk?

The docs talk about adding screen_hint=signup to the /authorize redirect request but as far as I can tell there’s no way to access that directly with the sdk?

Hi there @anna1 welcome to the community!

While I’m not a PHP/Laravel expert by any means, I’d be curious to know the method you are using to login (make call to /authorize) users in the first place.

Let me know!

Hi @annakopp :wave: Thanks for your question.

The Laravel SDK is built on top of the PHP SDK, so it inherits all the same functionality. If an alias for an underlying method is not provided by the Laravel SDK directly, you can access the underlying PHP SDK instance by calling getSdk() from the SDK’s Facade.

For example, here’s a route controller that calls the method you’re looking to use:

<?php

declare(strict_types=1);

namespace App\Controllers;

use Auth0\Laravel\Facade\Auth0;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

class SignupController
{
    public function __invoke(
        Request $request,
    ): Response {
		$url = Auth0::getSdk()->signup();
		return redirect()->away($url);
	}
}
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.