fix: use official Weeztix OAuth login and token URLs

Redirect to login.weeztix.com/login per docs; default token host to
auth.weeztix.com. Open Ticket setups can override via env.

Made-with: Cursor
This commit is contained in:
2026-04-05 09:51:11 +02:00
parent d3abdb7ed9
commit a3158ffa34
3 changed files with 32 additions and 9 deletions

View File

@@ -73,3 +73,9 @@ AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false AWS_USE_PATH_STYLE_ENDPOINT=false
VITE_APP_NAME="${APP_NAME}" VITE_APP_NAME="${APP_NAME}"
# Weeztix OAuth (defaults match https://docs.weeztix.com — only set if you use Open Ticket / another issuer)
# WEEZTIX_OAUTH_AUTHORIZE_URL=https://login.weeztix.com/login
# WEEZTIX_AUTH_BASE_URL=https://auth.weeztix.com
# WEEZTIX_USER_PROFILE_URL=https://auth.weeztix.com/users/me
# WEEZTIX_API_BASE_URL=https://api.weeztix.com

View File

@@ -52,9 +52,9 @@ class WeeztixOAuthController extends Controller
'state' => $state, 'state' => $state,
]); ]);
$authorizeBase = rtrim(config('weeztix.auth_base_url'), '/').'/tokens/authorize'; $authorizeUrl = config('weeztix.oauth_authorize_url');
return redirect()->away($authorizeBase.'?'.$query); return redirect()->away($authorizeUrl.'?'.$query);
} }
public function callback(Request $request): RedirectResponse public function callback(Request $request): RedirectResponse

View File

@@ -6,16 +6,34 @@ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| OAuth / token host (authorization code + refresh) | OAuth login / authorization (browser redirect)
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Defaults match the integration spec (Open Ticket auth). Token requests | Official Weeztix: users must be sent to login.weeztix.com with client_id,
| use {auth_base_url}/tokens; authorize URL is {auth_base_url}/tokens/authorize | redirect_uri, response_type=code, and state. Do NOT use auth.../tokens/authorize
| when using the same host layout as Weeztix/Open Ticket. | unless your OAuth provider documents that path (e.g. some Open Ticket setups).
|
| Open Ticket example (if your client was created there):
| WEEZTIX_OAUTH_AUTHORIZE_URL=https://auth.openticket.tech/tokens/authorize
| WEEZTIX_AUTH_BASE_URL=https://auth.openticket.tech
| |
*/ */
'auth_base_url' => rtrim((string) env('WEEZTIX_AUTH_BASE_URL', 'https://auth.openticket.tech'), '/'), 'oauth_authorize_url' => rtrim((string) env(
'WEEZTIX_OAUTH_AUTHORIZE_URL',
'https://login.weeztix.com/login'
), '/'),
/*
|--------------------------------------------------------------------------
| Token endpoint base (authorization code + refresh)
|--------------------------------------------------------------------------
|
| POST {auth_base_url}/tokens official Weeztix: https://auth.weeztix.com/tokens
|
*/
'auth_base_url' => rtrim((string) env('WEEZTIX_AUTH_BASE_URL', 'https://auth.weeztix.com'), '/'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -30,8 +48,7 @@ return [
| Current user profile (token validity + company hints) | Current user profile (token validity + company hints)
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Documented at https://docs.weeztix.com/docs/introduction/issue-request/ | Should match the issuer of your access_token (usually same host as auth_base_url).
| Uses auth.weeztix.com by default; override if your token issuer uses another host.
| |
*/ */