From 45beb1b10b70d0ea7634f12d90774174aeb1d0fc Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Mon, 2 Nov 2026 05:37:08 +0000 Subject: [PATCH] dev2 webmail googlecal: OAuth via the registered mynaposter relay (state wm.*); image cal3 The shared Google client is a Web-app client with only mynaposter.com's callback registered; its page relays state wm.* to webmail's callback (mynaposter PR). Co-Authored-By: Claude Opus 5.5 --- dev2/sites.d/webmail.profullstack.com.json | 2 +- dev2/webmail/googlecal/googlecal.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dev2/sites.d/webmail.profullstack.com.json b/dev2/sites.d/webmail.profullstack.com.json index 4795c8a..e4abb29 100644 --- a/dev2/sites.d/webmail.profullstack.com.json +++ b/dev2/sites.d/webmail.profullstack.com.json @@ -3,7 +3,7 @@ "service": "webmail.profullstack.com", "repo": null, "branch": null, - "image": "profullstack/webmail:1.7.5-cal2", + "image": "profullstack/webmail:1.7.5-cal3", "start_command": "apache2-foreground", "port_var": "80", "domains": [ diff --git a/dev2/webmail/googlecal/googlecal.php b/dev2/webmail/googlecal/googlecal.php index cc45eeb..b563177 100644 --- a/dev2/webmail/googlecal/googlecal.php +++ b/dev2/webmail/googlecal/googlecal.php @@ -71,7 +71,9 @@ public function connect() $this->rc->output->redirect(['_task' => 'settings', '_action' => 'edit-prefs', '_section' => 'googlecal']); return; } - $_SESSION['googlecal_state'] = $state = bin2hex(random_bytes(16)); + // "wm." routes the reply through the registered mynaposter.com relay page + // (apps/web/assets/oauth-callback.js) back to this server's callback. + $_SESSION['googlecal_state'] = $state = 'wm.' . bin2hex(random_bytes(16)); $url = self::AUTH_URL . '?' . http_build_query([ 'client_id' => $this->rc->config->get('googlecal_client_id'), 'redirect_uri' => $this->redirect_uri(),