Poke

Experience

230

0 Best Reply Awards

  • Member Since 1 Month Ago
  • 0 Lessons Completed
  • 0 Favorites

13th October, 2017

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

@sutherland can you link to it? :)

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

@Snapey well, this is default behavior from the auth scaffolding in Laravel. That's why I thought it was safe, I have now removed Vue, and it works perfect!

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

@Snapey I understood you. And as you say "if". And it was what happen, a user created a username with a curly bracket.

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

@Snapey as I just said, I do not :)

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

@sutherland Thank you very much, this fixed my issue. But still weird that the default js file has Vue, and that the default way of showing a logged in username is in a way that breaks the website.

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

This code?!

<body>
    <!---->

    <!-- Scripts -->
    <script src="http://127.0.0.1:8000/js/app.js"></script>
    

</body>

Or do you mean the {{ Auth::user()->name }}?

Because the {{ Auth::user()->name }} is getting transformed into the users name, it will spit out their name escaped, but since Vue then takes it and reads the curly brackets then it breaks.

That's at least how I understand it.

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

@sutherland is Vue with Laravel by default?

If it is then why is the default auth made in an un-escaped manner, which leads unskilled developers like me to believe it's the correct way to do it?

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

Step 1. Go to a sign up page. Step 2. Where it says name, put in {{ $Auth::User() }}, do whatever for email and password. Step 3. Login. Step 4. Website breaks, as I described above.

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

Ok, thanks! I don't know where Vue came from, I have no clue on what it does. So I will try to remove it from the compiled JS file. (Gonna look up on how to do that.)

And then come back here with an update!

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

Ok, so it's a flaw in Vue then? And when it breaks the website, it removes everything(nearly) from the website. And there are no console errors.

This is what's left in the body, and I have also tried this on a live server. Got the same result. This ain't good tho, if it breaks on the default auth scaffolding.

<body>
    <!---->

    <!-- Scripts -->
    <script src="http://127.0.0.1:8000/js/app.js"></script>
    

</body>

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

I am not outputting the entire user object. I just crate a new user named {{ $Auth::User() }} which then breaks the website, not gonna write how it breaks since I already did above.

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

It displays the name correctly when the app.js file is removed tho, so this is why I believe that the file has something to do with the website breaking.

Poke left a reply on {{ $Auth::User() }} Bug? • 1 month ago

If I create a user called {{ $Auth::User() }} then it flashes the website for a split second, and then everything goes blank. I don't fully know if it is that file that app.js but when its not there then it at least shows the website.

Doesn't matter with the dollar symbol, since it still breaks the website. Could be the curly brackets that does it.

Poke started a new conversation {{ $Auth::User() }} Bug? • 1 month ago

So I created a website with Laravel, and I just found out if I write {{ $Auth::User() }} anywhere where the user can input things that gets displayed on the website. It breaks.

For example a username, with the default auth scaffolding or in a forum post.

I found out if I remove the line that says <script src="{{ asset('js/app.js') }}"></script> in the main layouts app.blade.php file, then it works fine again.

This referres to the file in the public\js folder called app.js

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.