♻️ Apply more accurate authentication naming

- “authenticate” instead of “connect”
- “withCredentials” instead of “direct”
- “OAuth” instead of “ISU”
This commit is contained in:
Philipp Stracker 2025-01-08 14:59:59 +01:00
parent ac68aa7968
commit 1bf6e488a3
No known key found for this signature in database
5 changed files with 22 additions and 22 deletions

View file

@ -44,7 +44,7 @@ export const useHandleOnboardingButton = ( isSandbox ) => {
const { productionOnboardingUrl } = CommonHooks.useProduction();
const products = OnboardingHooks.useDetermineProducts();
const { withActivity } = CommonHooks.useBusyState();
const { connectViaAuthCode } = CommonHooks.useAuthentication();
const { authenticateWithOAuth } = CommonHooks.useAuthentication();
const [ onboardingUrl, setOnboardingUrl ] = useState( '' );
const [ scriptLoaded, setScriptLoaded ] = useState( false );
const timerRef = useRef( null );
@ -127,7 +127,7 @@ export const useHandleOnboardingButton = ( isSandbox ) => {
ACTIVITIES.CONNECT_ISU,
'Validating the connection details',
async () => {
await connectViaAuthCode(
await authenticateWithOAuth(
sharedId,
authCode,
environment
@ -148,7 +148,7 @@ export const useHandleOnboardingButton = ( isSandbox ) => {
// Ensure the onComplete handler is not removed by a PayPal init script.
timerRef.current = setInterval( addHandler, 250 );
},
[ connectViaAuthCode, withActivity ]
[ authenticateWithOAuth, withActivity ]
);
const removeCompleteHandler = useCallback( () => {
@ -211,7 +211,7 @@ export const useDirectAuthentication = () => {
useConnectionBase();
const { withActivity } = CommonHooks.useBusyState();
const {
connectViaSecret,
authenticateWithCredentials,
isManualConnectionMode,
setManualConnectionMode,
clientId,
@ -234,7 +234,7 @@ export const useDirectAuthentication = () => {
}
}
const res = await connectViaSecret();
const res = await authenticateWithCredentials();
if ( res.success ) {
await handleCompleted();