-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 from sharetribe/auth-with-idp-params
Fix auth with IdP params
- Loading branch information
Showing
9 changed files
with
84 additions
and
89 deletions.
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
Renames IdP related auth parameters to use snake case. | ||
Changes to `ctx`: | ||
Update following param names, if they exist: | ||
- change `ctx.params.idpId` to `ctx.params.idp_id` | ||
- change `ctx.params.idpClientId` to `ctx.params.idp_client_id` | ||
- change `ctx.params.idpToken` to `ctx.params.idp_token` | ||
*/ | ||
export default class RenameIdpParamsForAuth { | ||
enter({ params, ...ctx }) { | ||
const { idpId, idpClientId, idpToken, ...rest } = params; | ||
|
||
const idpIdObj = idpId ? { idp_id: idpId } : null; | ||
const idpClientIdObj = idpClientId ? { idp_client_id: idpClientId } : null; | ||
const idpTokenObj = idpToken ? { idp_token: idpToken } : null; | ||
|
||
return { | ||
...ctx, | ||
params: { | ||
...idpIdObj, | ||
...idpClientIdObj, | ||
...idpTokenObj, | ||
...rest, | ||
}, | ||
}; | ||
} | ||
} |
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
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