forked from jwplayer/ott-web-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: route
cxl-sso
redirect to WordPress OAuth endpoint
- Loading branch information
Showing
3 changed files
with
18 additions
and
22 deletions.
There are no files selected for viewing
20 changes: 0 additions & 20 deletions
20
packages/ui-react/src/pages/RedirectToExternal/RedirectToExternal.ts
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
packages/ui-react/src/pages/RedirectToExternal/RedirectToSSO.ts
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,16 @@ | ||
import React, { useEffect } from 'react'; | ||
import { useOAuth } from '@jwp/ott-hooks-react/src/useOAuth'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
const RedirectToSSO: React.FC = () => { | ||
const navigate = useNavigate(); | ||
const { login: oAuthLogin } = useOAuth(); | ||
|
||
useEffect(() => { | ||
oAuthLogin(); | ||
}, [navigate, oAuthLogin]); | ||
|
||
return null; // Render nothing | ||
}; | ||
|
||
export default RedirectToSSO; |
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