valdinei.lima

Experience

111,475

0 Best Reply Awards

  • Member Since 3 Years Ago
  • 1207 Lessons Completed
  • 39 Favorites

19th January, 2018

valdinei.lima left a reply on How Would I Do A Middleware To Catch The User If There Is A Token And If It Does Not Have A Token, To Continue Without Blocking The Request? • 7 months ago

@martinbean I was calling "$user = auth()->user();" without specifying the guard. Now it worked by passing this way "$user = auth('api')->user();"

thank you so much!

valdinei.lima left a reply on How Would I Do A Middleware To Catch The User If There Is A Token And If It Does Not Have A Token, To Continue Without Blocking The Request? • 7 months ago

@martinbean My campaign route returns a attribute "total_points = 0". But if a user who found this route sent a token, then I need to get the user data to return the points of it.

For me to use "auth()->user()" inside controller, I have to go through an "auth: api" middleware, in this case a no longer public route because it would always require a token.

So, I have not added the "auth()->user()" middleware so that you are more public, but I am not welcome to the user on the route.

18th January, 2018

valdinei.lima left a reply on How Would I Do A Middleware To Catch The User If There Is A Token And If It Does Not Have A Token, To Continue Without Blocking The Request? • 7 months ago

Let's forget a previous question. Now, how would I return a User, just knowing the token. How do I ask for Laravel Passport which is the user only informing the a string token?

valdinei.lima left a reply on How Would I Do A Middleware To Catch The User If There Is A Token And If It Does Not Have A Token, To Continue Without Blocking The Request? • 7 months ago

Are you saying: If the user is logged in, show them their own private data when they visit /campaign/ but if they are not logged in, show all of the public items?

The frontend is a SPA in VUE.

The route 'campaign/{slug?}' is public, it can be accessed without a token. However, the SPA can sometimes send token in the header. If there is a token I would like to check return the user.

16th January, 2018

valdinei.lima started a new conversation How Would I Do A Middleware To Catch The User If There Is A Token And If It Does Not Have A Token, To Continue Without Blocking The Request? • 7 months ago

Hello everyone, I have a "domain.com/v1/campaigns" route that returns a list of data. This route does not need to have a token to access. But if there is a token entered in the header, I'd like to return the user's data. I can not use the "auth: api" middleware because it would make the route always require a token, and that would not be the case. The token on this route would be optional. How would I do a middleware to catch the user if there is a token and if it does not have a token, to continue without blocking the request?

18th November, 2017

valdinei.lima started a new conversation Friends, I'm In Need Of Help To Solve A Problem With Grouped Queries • 9 months ago

I need to list all the records (campaigns) of one partner and do a grouping by status type of all the records of a specific partner.

database lists: https://pasteboard.co/GUcTBd8.png

17th November, 2016

valdinei.lima left a reply on Problems With Domains Without SSL • 1 year ago

up

15th November, 2016

valdinei.lima left a reply on Laracasts Refresh • 1 year ago

awesome!!!

9th November, 2016

valdinei.lima started a new conversation Problems With Domains Without SSL • 1 year ago

I have some domains hosted on Digital Ocean using the forge. Some using SSL and some not. As an example I will mention two areas:

site1 https://cbnlondrina.com site2 http://comfortga.com.br

Forge configuration: https://s17.postimg.org/t7z13lefz/Captura_de_Tela_2016_11_09_a_s_14_47_47.png

The problem is that when I add https to a domain that does not have SSL configured, it redirects the site to another domain.

See: https://s22.postimg.org/d47repx0h/Captura_de_Tela_2016_11_09_a_s_14_54_57.png

I tried to access https://comfortga.com.br, appeared a message that has no certificate, I clicked in advanced and processed, the result was, the display of the site cbnlondrina.com.br, but in the navigation bar is the https://comfortga.com.br

How would I make it so that when a user forces http: // comfortga.com.br to redirect to http://confortga.com.br?

8th September, 2016

valdinei.lima started a new conversation Uncaught (in Promise) TypeError: Cannot Read Property • 1 year ago

Hi guys. I'm having a problem to use the data returned after consulting the server.

The error I have to answer, is that I can not read a property that I get. This error occurs only in a production environment. On my computer, so develop is working perfectly.

My Login.vue

<script>
    export default {

        data() {
            return {
                validation: '',
                processing: false,
                form: {
                    email: '',
                    password: ''
                }
            }
        },

        methods: {

            /**
             * Authenticate account user
             */
            login() {

                // Clear errors
                this.$set('validation', '');
                this.$set('processing', true);

                // Send request to api
                this.$http.post(config.api.endpoints.authenticateAccount, this.form).then(
                        response => {
                            var $token = response.data.data.token;
                            var $user = response.data.data.user.data;

                            localStorage.setItem(config.keys.token, $token);
                            localStorage.setItem(config.keys.user, JSON.stringify($user));

                            this.$dispatch('userLoggedIn', $user);
                            this.$set('processing', false);
                            router.go('/');
                        },
                        error => {
                            this.$set('validation', error.data);
                            this.$set('processing', false);
                        }
                );
            }

        }


    }
</script>

Console error

Console error datail

Api response 200

Recalling that locally, everything works. Even when I use 'gulp --production'. Where am I going wrong? Thank you!!!

25th July, 2016

valdinei.lima started a new conversation Problem Accessing The Https Protocol On A Site That Does Not Have The Certificate • 2 years ago

Good morning people. I have a problem on a server hosted in DigitalOcean using Forge.

I have 4 sites on the same server, follows:

  1. sitea.com (ssl active)
  2. siteb.com (ssl active)
  3. sitec.com (without SSL)
  4. sited.com (ssl active)

All are working well, just I found a problem accessing the "sitec.com". The problem is that if I access with the HTTPS protocol, the server complains that it has no valid certificate when accept proceed without the certificate to see what happens, it redirects me to another site "sitea.com"

Can anyone tell me how to solve it?

21st August, 2015

valdinei.lima left a reply on Deploy Laravel On Dedicated Server Problem • 3 years ago

up +1

Edit Your Profile
Update

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