forked from rauchg/slackin
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix redirecting already-registered users from iframe dialog
One thing missing from rauchg#126/rauchg#143, which intro'd the feature of redirecting already-signed-up users to Slack, was support for the iframe dialog that the "Realtime Badge" button thing pops up: https://github.com/rauchg/slackin#realtime-badge In simpler times this would've been a 4-character fix: - location.href = res.body.redirectUrl; + top.location.href = res.body.redirectUrl; But nowadays people have futile "policies" trying to be "secure" about their "content" and "sand" "box" "our" "i" "frames"---bottom line is, top.location.href doesn't pass muster anymore for a library that's going to run in arbitrary pages on arbitrary servers. Enter the postMessage() RPC hack.
- Loading branch information
1 parent
e3d3194
commit c775538
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters