Skip to content

[IMPROVE] Support for Google OAuth for mobile app#22014

Merged
sampaiodiego merged 2 commits intodevelopfrom
feat/google-oauth-mobile
May 21, 2021
Merged

[IMPROVE] Support for Google OAuth for mobile app#22014
sampaiodiego merged 2 commits intodevelopfrom
feat/google-oauth-mobile

Conversation

@pierre-lehnen-rc
Copy link
Contributor

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Copy link
Member

@sampaiodiego sampaiodiego left a comment

Choose a reason for hiding this comment

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

I'm approving but I'll let it opened still since I added some comments, but them could be addressed in the future, would be better if we could address before merging though.

// The code on this file was copied directly from Meteor and modified to support mobile google oauth
// https://github.com/meteor/meteor/blob/ffcfa5062cf1bf8a64ea64fef681ffcd99fe7939/packages/oauth/oauth_server.js

Meteor.startup(() => {
Copy link
Member

Choose a reason for hiding this comment

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

any special reason to have this in a Meteor.startup? Otherwise I'd remove it.

redirectUrl = OAuth._stateFromQuery(details.query).redirectUrl;
const appHost = Meteor.absoluteUrl();

if (redirectUrl.startsWith(appRedirectUrl)) {
Copy link
Member

Choose a reason for hiding this comment

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

we might need to think a way to have this custom code easier to spot and maintain. Let's say on next Meteor version this code changes and we need to copy the new code over here, it might be not that easy to spot our changes and keep them.

import '../app/file-upload';
import '../app/github-enterprise/server';
import '../app/gitlab/server';
import '../app/google-oauth/server';
Copy link
Member

Choose a reason for hiding this comment

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

we should not create new things inside /app folder. we need to think where this file would fit in a new folder structure.

since this is overwriting Meteor's internal functions, maybe we could make that explicit making it easier to spot possible issues when updating Meteor.. maybe something like /server/overwrites/meteor/oauth.js .. idk, didn't like "overwrites" 🙈 wdyt?

Copy link
Member

Choose a reason for hiding this comment

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

What about /server/custom/...

@sampaiodiego sampaiodiego changed the title [NEW] Support for google OAuth on mobile [IMPROVE] Support for Google OAuth for mobile app May 21, 2021
@sampaiodiego sampaiodiego merged commit 3db5918 into develop May 21, 2021
@sampaiodiego sampaiodiego deleted the feat/google-oauth-mobile branch May 21, 2021 00:36
@sampaiodiego sampaiodiego mentioned this pull request May 28, 2021
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.

3 participants

Comments