Skip to content

Commit 12c8384

Browse files
committed
move "forgot your password" link to reset-password scaffold
1 parent 6272058 commit 12c8384

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/Resources/scaffolds/6.0/reset-password.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,18 @@
1919
'config/packages/reset_password.yaml',
2020
file_get_contents(__DIR__.'/reset-password/config/packages/reset_password.yaml')
2121
);
22+
23+
$login = $files->getFileContents('templates/login.html.twig');
24+
$forgotPassword = "</button>\n <a class=\"btn btn-link\" href=\"{{ path('reset_password_request') }}\">Forgot your password?</a>";
25+
26+
if (str_contains($login, $forgotPassword)) {
27+
return;
28+
}
29+
30+
$files->dumpFile('templates/login.html.twig', str_replace(
31+
'</button>',
32+
$forgotPassword,
33+
$login
34+
));
2235
},
2336
];

src/Resources/scaffolds/6.0/starter-kit.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,5 @@
1313
],
1414
'configure' => function(FileManager $files) {
1515
$files->dumpFile('templates/base.html.twig', file_get_contents(__DIR__.'/starter-kit/templates/base.html.twig'));
16-
17-
$login = $files->getFileContents('templates/login.html.twig');
18-
$forgotPassword = "</button>\n <a class=\"btn btn-link\" href=\"{{ path('reset_password_request') }}\">Forgot your password?</a>";
19-
20-
if (str_contains($login, $forgotPassword)) {
21-
return;
22-
}
23-
24-
$files->dumpFile('templates/login.html.twig', str_replace(
25-
'</button>',
26-
$forgotPassword,
27-
$login
28-
));
2916
},
3017
];

0 commit comments

Comments
 (0)