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

Add parseFrameURL for masking user-facing pages. #3091

Closed
wants to merge 0 commits into from

Conversation

lenart
Copy link
Contributor

@lenart lenart commented Nov 21, 2016

Allow users to specify a different address which is used to mask parse requests for verifying email and resetting password. This is how Parse.com used to allow customers to gain control over page content, styling etc.

On the destination page javascript is used to check the link in the request and embed the parse server page using IFRAME.

First discussed in #3090

Copy link
Contributor

@flovilmart flovilmart left a comment

Choose a reason for hiding this comment

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

CAn you add unit tests so we make sure the URL's are still properly generated and the new URL's are properly generated too?

@@ -236,6 +236,10 @@ export class Config {
return this.customPages.passwordResetSuccess || `${this.publicServerURL}/apps/password_reset_success.html`;
}

get parseFrameURL() {
return this.customPages.parseFrameURL || null;
Copy link
Contributor

Choose a reason for hiding this comment

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

do not use null, we use undefined as bottom value. You should probably check if this.customPages is not undefined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rebased and will just return the value of parseFrameURL which will be undefined if, well, undefined.

@facebook-github-bot
Copy link

@lenart updated the pull request - view changes

@facebook-github-bot
Copy link

@lenart updated the pull request - view changes

@lenart
Copy link
Contributor Author

lenart commented Nov 21, 2016

I'm currently under pressure with current deadline - migrating app to self-hosted parse. I have 0 milage with javascript testing and currently can't afford the effort of learning how to do it.

What needs to be tested is buildVerificationLink with the following scenarios:

it "adds token and username to params"

context "parseFrameURL not provided"
  it "uses destination"
end

context "when parseFrameURL defined"
  it "uses parseFrameURL"
  it "adds destination as link param"
end

@facebook-github-bot
Copy link

@lenart updated the pull request - view changes

@flovilmart
Copy link
Contributor

Note that the build is broken, you can run npm test locally to make sure the CI passes.

@facebook-github-bot
Copy link

@lenart updated the pull request - view changes

@facebook-github-bot
Copy link

@lenart updated the pull request - view changes

@lenart
Copy link
Contributor Author

lenart commented Nov 23, 2016

I can confirm this code works as expected - providing the same functionality that Parse.com did with it's Frame URL.

🆘 However I'd like to ask for help of someone that is more comfortable with node to write up the required specs.

@facebook-github-bot
Copy link

@lenart updated the pull request - view changes

@lenart
Copy link
Contributor Author

lenart commented Dec 8, 2016

@flovilmart could you maybe find someone that's comfortable in node stack to write up tests for this PR? I really don't want it to be hanging around just because there is no test coverage.

@flovilmart
Copy link
Contributor

I'll have a look :)

@facebook-github-bot
Copy link

@lenart updated the pull request - view changes

jugaldesai added a commit to jugaldesai/parse-server that referenced this pull request Feb 13, 2017
This is the sample file mentioned in the parse-community#3257 parse-community#3091 which everyone is requesting. 

var api = new ParseServer({
...,
customPages: {
parseFrameURL: "http://myserver.com/handle-parse-iframe",
...
}

The parseFrameURL is actually where this HTML file will be hosted and will appear as a FrameURL to show the pages hosted using parse API.
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