Skip to content

Commit

Permalink
Fixes a bug wherein the 'resend mail' would result in a '405 method n…
Browse files Browse the repository at this point in the history
…ot allowed'. (#142)
  • Loading branch information
HerrLevin authored Oct 5, 2020
1 parent f29d07a commit d8e808a
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 69 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public/uploads/avatars
# Laravel 4 specific
bootstrap/compiled.php
app/storage/
bootstrap/cache

# Laravel 5 & Lumen specific
public/storage
Expand Down
6 changes: 1 addition & 5 deletions app/Http/Controllers/FrontendStatusController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ public function getDashboard() {
$statuses = StatusBackend::getDashboard($user);

if (!$user->hasVerifiedEmail() && $user->email != null) {
\Session::flash('message',
__('controller.status.email-not-verified',
['url' => route('verification.resend')]
)
);
\Session::flash('mail-prompt', __('controller.status.email-not-verified'));
}
if ($statuses->isEmpty() || $user->follows->count() == 0) {
if (Session::has('checkin-success')) {
Expand Down
65 changes: 33 additions & 32 deletions resources/lang/de/controller.php
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
<?php
return [
"social" => [
"social" => [
"already-connected-error" => "Dieser Account ist bereits mit einem anderen Nutzer verknüpft.",
"create-error" => "Es gab ein Problem beim Erstellen Deines Accounts.",
"delete-never-connected" => "Du hast keinen Social-Login-Provider.",
"delete-set-password" => "Bevor du einen SSO-Provider löschst, musst du ein Passwort festlegen, um dich nicht auszusperren.",
"deleted" => "Die Verbindung wurde aufgehoben."
"create-error" => "Es gab ein Problem beim Erstellen Deines Accounts.",
"delete-never-connected" => "Du hast keinen Social-Login-Provider.",
"delete-set-password" => "Bevor du einen SSO-Provider löschst, musst du ein Passwort festlegen, um dich nicht auszusperren.",
"deleted" => "Die Verbindung wurde aufgehoben."
],
"status" => [
"status-not-found" => "Status nicht gefunden",
"create-success" => "Status erstellt.",
"delete-ok" => "Status gelöscht.",
"email-not-verified" => "Du hast Deine Email-Adresse noch nicht verifiziert. Bestätigung <a href=\":url\">erneut senden</a>.",
"export-invalid-dates" => "Das sind keine validen Daten.",
"status" => [
"status-not-found" => "Status nicht gefunden",
"create-success" => "Status erstellt.",
"delete-ok" => "Status gelöscht.",
"email-not-verified" => "Du hast Deine Email-Adresse noch nicht verifiziert.",
"email-resend-mail" => "Bestätigung erneut senden.",
"export-invalid-dates" => "Das sind keine validen Daten.",
"export-neither-business" => "Du kannst nicht sowohl Privat- als auch Business-Trips abwählen.",
"like-already" => "Like existiert bereits.",
"like-deleted" => "Like gelöscht.",
"like-not-found" => "Like nicht gefunden.",
"like-ok" => "Liked!",
"not-permitted" => "DAS darfst Du nicht."
"like-already" => "Like existiert bereits.",
"like-deleted" => "Like gelöscht.",
"like-not-found" => "Like nicht gefunden.",
"like-ok" => "Liked!",
"not-permitted" => "DAS darfst Du nicht."
],
"transport" => [
"checkin-heading" => "Eingecheckt",
"checkin-ok" => "Du hast erfolgreich in :lineName eingecheckt!|Du hast erfolgreich in Linie :lineName eingecheckt!",
"no-name-given" => "Du musst einen Stationsnamen angeben!",
"not-in-stopovers" => "Die Start-ID ist nicht in den Zwischenstops.",
"overlapping-checkin" => "Du hast bereits einen Check-In in Verbindung :linename: <a href=\":url\">#:id</a>",
"also-in-connection" => "Auch in dieser Verbindung sind:",
"social-post" => "Ich bin gerade in :lineName nach :Destination! #NowTräwelling |Ich bin gerade in Linie :lineName nach :Destination! #NowTräwelling ",
"checkin-heading" => "Eingecheckt",
"checkin-ok" => "Du hast erfolgreich in :lineName eingecheckt!|Du hast erfolgreich in Linie :lineName eingecheckt!",
"no-name-given" => "Du musst einen Stationsnamen angeben!",
"not-in-stopovers" => "Die Start-ID ist nicht in den Zwischenstops.",
"overlapping-checkin" => "Du hast bereits einen Check-In in Verbindung :linename: <a href=\":url\">#:id</a>",
"also-in-connection" => "Auch in dieser Verbindung sind:",
"social-post" => "Ich bin gerade in :lineName nach :Destination! #NowTräwelling |Ich bin gerade in Linie :lineName nach :Destination! #NowTräwelling ",
"social-post-with-event" => "Ich bin gerade in :lineName nach :destination für #:hashtag! #NowTräwelling | Ich bin gerade in Linie :lineName nach #destination für #:hashtag! #NowTräwelling ",
"social-post-for" => " für #:hashtag",
"no-station-found" => "Für diese Suche wurde keine Haltestelle gefunden.",
"social-post-for" => " für #:hashtag",
"no-station-found" => "Für diese Suche wurde keine Haltestelle gefunden.",
],
"user" => [
"follow-404" => "Dieser Follow existierte gar nicht.",
"follow-already-exists" => "Du folgst dieser Person bereits.",
"user" => [
"follow-404" => "Dieser Follow existierte gar nicht.",
"follow-already-exists" => "Du folgst dieser Person bereits.",
"follow-delete-not-permitted" => "Diese Aktion ist nicht erlaubt.",
"follow-destroyed" => "Du folgst dieser Person nicht mehr.",
"follow-ok" => "Benutzer gefolgt.",
"password-changed-ok" => "Passwort geändert.",
"password-wrong" => "Altes Passwort ist falsch."
"follow-destroyed" => "Du folgst dieser Person nicht mehr.",
"follow-ok" => "Benutzer gefolgt.",
"password-changed-ok" => "Passwort geändert.",
"password-wrong" => "Altes Passwort ist falsch."
]
];
65 changes: 33 additions & 32 deletions resources/lang/en/controller.php
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
<?php
return [
"social" => [
"social" => [
"already-connected-error" => "This Account is already connected to another user",
"create-error" => "There has been an error creating your account.",
"delete-never-connected" => "Your user does not have a Social Login provider",
"delete-set-password" => "You need to set a password before deleting a SSO-Provider to prevent you from locking yourself out.",
"deleted" => "Social Login Provider has been deleted"
"create-error" => "There has been an error creating your account.",
"delete-never-connected" => "Your user does not have a Social Login provider",
"delete-set-password" => "You need to set a password before deleting a SSO-Provider to prevent you from locking yourself out.",
"deleted" => "Social Login Provider has been deleted"
],
"status" => [
"status-not-found" => "Status not found",
"create-success" => "Status successfully created!",
"delete-ok" => "Status successfully deleted.",
"email-not-verified" => "You have not verified your mail yet! <a href=\":url\">Resend link</a>",
"export-invalid-dates" => "Those aren't valid dates.",
"status" => [
"status-not-found" => "Status not found",
"create-success" => "Status successfully created!",
"delete-ok" => "Status successfully deleted.",
"email-not-verified" => "You have not verified your mail yet!",
"email-resend-mail" => "Resend link.",
"export-invalid-dates" => "Those aren't valid dates.",
"export-neither-business" => "You can't uncheck both private and business trips",
"like-already" => "Like already exists",
"like-deleted" => "Like deleted",
"like-not-found" => "Like not found",
"like-ok" => "Like created",
"not-permitted" => "You 're not permitted to do this"
"like-already" => "Like already exists",
"like-deleted" => "Like deleted",
"like-not-found" => "Like not found",
"like-ok" => "Like created",
"not-permitted" => "You 're not permitted to do this"
],
"transport" => [
"checkin-heading" => "Checked in!",
"checkin-ok" => "You've successfully checked into :lineName!|You've successfully checked into line :lineName!",
"no-name-given" => "You need to provide a station name!",
"not-in-stopovers" => "Start-ID is not in stopovers.",
"overlapping-checkin" => "You have an overlapping checkin with connection :linename: <a href=\":url\">#:id</a>",
"also-in-connection" => "Also in this connection are:",
"social-post" => "I'm in :lineName towards :Destination! #NowTräwelling |I'm in line :lineName towards :Destination! #NowTräwelling ",
"checkin-heading" => "Checked in!",
"checkin-ok" => "You've successfully checked into :lineName!|You've successfully checked into line :lineName!",
"no-name-given" => "You need to provide a station name!",
"not-in-stopovers" => "Start-ID is not in stopovers.",
"overlapping-checkin" => "You have an overlapping checkin with connection :linename: <a href=\":url\">#:id</a>",
"also-in-connection" => "Also in this connection are:",
"social-post" => "I'm in :lineName towards :Destination! #NowTräwelling |I'm in line :lineName towards :Destination! #NowTräwelling ",
"social-post-with-event" => "I'm in :lineName towards #:hashtag via :Destination! #NowTräwelling | I'm in Line :lineName towards #:hashtag via :Destination! #NowTräwelling ",
"social-post-for" => " for #:hashtag",
"no-station-found" => "No station has been found for this search.",
"social-post-for" => " for #:hashtag",
"no-station-found" => "No station has been found for this search.",
],
"user" => [
"follow-404" => "This follow does not exist.",
"follow-already-exists" => "This follow already exists.",
"user" => [
"follow-404" => "This follow does not exist.",
"follow-already-exists" => "This follow already exists.",
"follow-delete-not-permitted" => "This action is not permitted.",
"follow-destroyed" => "This follow has been destroyed.",
"follow-ok" => "Followed user.",
"password-changed-ok" => "Password changed.",
"password-wrong" => "Password wrong."
"follow-destroyed" => "This follow has been destroyed.",
"follow-ok" => "Followed user.",
"password-changed-ok" => "Password changed.",
"password-wrong" => "Password wrong."
]
];
16 changes: 16 additions & 0 deletions resources/views/includes/message-block.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@
</div>
@endif

@if($message = Session::get('mail-prompt'))
<div class="alert alert-info alert-block">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>{!! $message !!}</strong>
<button class="btn btn-default" href="{{ route('verification.resend') }}"
onclick="event.preventDefault(); document.getElementById('resend-mail-form').submit();">
{{ __('controller.status.email-resend-mail') }}
</button>

<form id="resend-mail-form" action="{{ route('verification.resend') }}" method="POST"
style="display: none;">
@csrf
</form>
</div>
@endif

@if(Session::has('message'))
<div class="alert my-3 alert-info" role="alert">
{!! Session::get('message') !!}
Expand Down

0 comments on commit d8e808a

Please sign in to comment.