GithubHelp home page GithubHelp logo

Comments (12)

dacastro4 avatar dacastro4 commented on May 17, 2024

@mcgregorjamie Can you tell me if the file is named gmail-json-?

from laravel-gmail.

mcgregorjamie avatar mcgregorjamie commented on May 17, 2024

Yes the file is gmail-json.json

from laravel-gmail.

dacastro4 avatar dacastro4 commented on May 17, 2024

Hopefully, thanks to @nasatome, this issue is solved.

from laravel-gmail.

mcgregorjamie avatar mcgregorjamie commented on May 17, 2024

@dacastro4 Still having the same issue unfortunately :(

from laravel-gmail.

dacastro4 avatar dacastro4 commented on May 17, 2024

@mcgregorjamie

  1. did you log in before changing allow_multiple_credentials to true? if so, try to removing the file and trying it again.
  2. Is the route where you have all the user information inside of a group with the auth middleware?

from laravel-gmail.

mcgregorjamie avatar mcgregorjamie commented on May 17, 2024

@dacastro4

  1. I've tried removing the file but the same thing happens.
  2. Sorry, not sure I understand. Which route needs to be inside a group with the auth middleware? I followed the readme.md so my routes look like this:
Route::get('/oauth/gmail', function (){
    return LaravelGmail::redirect();
});

Route::get('/oauth/gmail/callback', function (){
    LaravelGmail::makeToken();
    return redirect()->to('/');
});

Route::get('/oauth/gmail/logout', function (){
    LaravelGmail::logout(); //It returns exception if fails
    return redirect()->to('/');
});

from laravel-gmail.

dacastro4 avatar dacastro4 commented on May 17, 2024

@mcgregorjamie that may be the problem. Enclose that code inside

Route::group(['middleware' => ['auth']], function() {
    //
});

from laravel-gmail.

mcgregorjamie avatar mcgregorjamie commented on May 17, 2024

That has fixed it, thank you so much for all of your help!

from laravel-gmail.

dacastro4 avatar dacastro4 commented on May 17, 2024

@mcgregorjamie No problem!

from laravel-gmail.

nasatome avatar nasatome commented on May 17, 2024

Sorry to open this problem again, but I think we should put in the documentation that to use multiple users, the user should be logged in with laravel previously (since the user's id is used to save the json)

I was thinking of some method of using multiple users without needing the user ID (which is standard and repeatable) but I can not think of any at this time, and in the current state of laravel-gmail to throw an error if the person has enabled in true "allow_multiple_credentials" and the user is not logged.

Allowing multiple users to be used without the user being logged in (using an id, such as the person's email but hashed SHA-2 + algorithm to avoid collisions) would allow oauth2.0 to even be used as a system login and completely replace the use of other plugins such as "Laravel Socialite" for particular uses of Google

I do not know, they are just crazy ideas in my mind.

going back to the starting point, for now, @dacastro4 , what do you think of the action of placing in the documentation that it is necessary for the user to be authenticated with laravel in order for the multiple credentials to work?

from laravel-gmail.

alalfakawma avatar alalfakawma commented on May 17, 2024

@mcgregorjamie that may be the problem. Enclose that code inside

Route::group(['middleware' => ['auth']], function() {
    //
});

Can I use the auth middleware for api calls?

from laravel-gmail.

dacastro4 avatar dacastro4 commented on May 17, 2024

@alalfakawma you should be able to use it with the auth:api middleware

from laravel-gmail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.