From 1a1ccec5a3c019030a5a403d1e292893b0daf0d8 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 19 Jun 2015 11:43:36 +0930 Subject: [PATCH] Get signup working again --- .../src/Core/Handlers/Events/EmailConfirmationMailer.php | 5 ++++- framework/core/src/Forum/Actions/WritesRememberCookie.php | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/framework/core/src/Core/Handlers/Events/EmailConfirmationMailer.php b/framework/core/src/Core/Handlers/Events/EmailConfirmationMailer.php index 7cf49b09f..3d1ac81a0 100755 --- a/framework/core/src/Core/Handlers/Events/EmailConfirmationMailer.php +++ b/framework/core/src/Core/Handlers/Events/EmailConfirmationMailer.php @@ -61,9 +61,12 @@ class EmailConfirmationMailer { $token = $this->generateToken($user, $email); + // TODO: Need to use UrlGenerator, but since this is part of core we + // don't know that the forum routes will be loaded. Should the confirm + // email route be part of core?? return [ 'username' => $user->username, - 'url' => route('flarum.forum.confirmEmail', ['token' => $token->id]), + 'url' => Core::config('base_url').'/confirm/'.$token->id, 'forumTitle' => Core::config('forum_title') ]; } diff --git a/framework/core/src/Forum/Actions/WritesRememberCookie.php b/framework/core/src/Forum/Actions/WritesRememberCookie.php index 6d8753fcc..0608933b5 100644 --- a/framework/core/src/Forum/Actions/WritesRememberCookie.php +++ b/framework/core/src/Forum/Actions/WritesRememberCookie.php @@ -11,7 +11,9 @@ trait WritesRememberCookie // Set a long-living cookie (two weeks) with the remember token return FigResponseCookies::set( $response, - SetCookie::create('flarum_remember', $token)->withMaxAge(14 * 24 * 60 * 60) + SetCookie::create('flarum_remember', $token) + ->withMaxAge(14 * 24 * 60 * 60) + ->withPath('/') ); } @@ -20,7 +22,9 @@ trait WritesRememberCookie // Delete the cookie by setting it to an expiration date in the past return FigResponseCookies::set( $response, - SetCookie::create('flarum_remember')->withMaxAge(-2628000) + SetCookie::create('flarum_remember') + ->withMaxAge(-2628000) + ->withPath('/') ); } }