Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add public url #86

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_PUBLIC_URL=http://localhost
APP_IS_VPN=false

APP_PORTALS_URL=http://127.0.0.1:8000
Expand Down
8 changes: 7 additions & 1 deletion app/Models/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,15 @@ public function createAuthLink()
{
$this->generateAuthToken();

return route('person.authWithToken', [
// generate the route
$personAuthWithTokenRoute = route('person.authWithToken', [
'id' => $this->id,
'token' => $this->auth_token
]);

// get only the path
$personAuthWithTokenRoute = parse_url($personAuthWithTokenRoute, PHP_URL_PATH);

return config('app.public_url') . $personAuthWithTokenRoute;
}
}
2 changes: 2 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@

'url' => env('APP_URL', 'http://localhost'),

'public_url' => env('APP_PUBLIC_URL', 'http://localhost'),

'asset_url' => env('ASSET_URL', null),

/*
Expand Down
Loading