Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email-based user model and google auth #2

Merged
merged 14 commits into from
Dec 20, 2016
Merged

email-based user model and google auth #2

merged 14 commits into from
Dec 20, 2016

Conversation

Pomax
Copy link
Contributor

@Pomax Pomax commented Dec 15, 2016

some oddities in this PR due to what manage.py decided to do: the "default inserts" should probably be in a place that doesn't get blasted away when you regenerated migrations "from scratch" because it looks like this branch did exactly that thing...

This definitely needs your eyes @alanmoo, before we merge this in.

@Pomax Pomax requested a review from alanmoo December 15, 2016 23:39

SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'
SESSION_COOKIE_AGE = 60 * 60 * 24 * 31
SECRET_KEY = 'Oh my god I love cake so much holy shit how amazing is cake; like, seriously?'
Copy link
Contributor

Choose a reason for hiding this comment

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

lol


data = json.dumps(client_secrets)

text_file = open("client_secrets.json", "w")
Copy link
Contributor

Choose a reason for hiding this comment

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

This should create the file if it doesn't already exist.

Copy link
Contributor

Choose a reason for hiding this comment

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

To get migrate to work, I had to paste in the web object and all its keys (with empty strings) to a manually generated client_secrets.json.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, yeah, this is due to the "global" Flow object in the user model - it kicks in simply by loading up the code so it might be worth turning that into something that has a def getFlowObject(): ... that creates it if Flow is None and otherwise just does a passthrough, so there's nothing that breaks when client_secrets.json doesn't exist yet...

Copy link
Contributor

Choose a reason for hiding this comment

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

We need this rigamarole of env var -> JSON because of the way Heroku works, right?

Copy link
Contributor Author

@Pomax Pomax Dec 16, 2016

Choose a reason for hiding this comment

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

not strictly heroku, but yes: we don't want to check in a client_secrets.json, and the auth library does not read in values from env, so we need a little script that can generate the file the library wants, based on variables in the active environment

(why their lib can't just read in "either from file or from env", I do not know... )

@Pomax Pomax changed the title [WIP] email-based user model and google auth email-based user model and google auth Dec 20, 2016
@Pomax Pomax merged commit 663dab4 into master Dec 20, 2016
@Pomax Pomax deleted the usered branch December 20, 2016 20:24
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.

None yet

2 participants