Skip to content

Conversation

@mbirman
Copy link
Contributor

@mbirman mbirman commented Apr 25, 2019

This PR is a work in progress.

  • gmail gem removed, google-api-ruby-client installed.
  • Authorizer class created that fetches credentials and stores them in the configuration file.

Copy link
Owner

@caffo caffo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally had time to start checking this. Please check my comment.


class << self
def call(user_id)
raise "Google Client ID or Google Client Secret are invalid." if invalid_keys?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I try to run bin/baconmail authorize I get the following error:

baconmail/lib/baconmail/authorizer.rb:12:in `call': Google Client ID or Google Client Secret are invalid. (RuntimeError)

I think you are checking if the keys are invalid before we fetch them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caffo hmm, did you add the keys to .baconmail? See an example in README: https://github.com/mbirman/baconmail/tree/google-api-client#setup-instructions

@caffo
Copy link
Owner

caffo commented Jun 5, 2019 via email

@mbirman
Copy link
Contributor Author

mbirman commented Jun 6, 2019

@caffo no, it can't :( You have to add client id and secret to .baconmail file manually, the script will fetch authorization key and store it with credentials for future use.

@caffo
Copy link
Owner

caffo commented Jun 7, 2019 via email

@mbirman
Copy link
Contributor Author

mbirman commented Jun 8, 2019

Yeah, good idea! I've added a link to Google API wizard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants