Skip to content

Commit

Permalink
Remove unused parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolen committed Nov 14, 2024
1 parent be60f00 commit 1ab2d64
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/libs/actions/Session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ function beginGoogleSignIn(token: string | null) {
* Will create a temporary login for the user in the passed authenticate response which is used when
* re-authenticating after an authToken expires.
*/
function signInWithShortLivedAuthToken(email: string, authToken: string) {
function signInWithShortLivedAuthToken(authToken: string) {
const {optimisticData, finallyData} = getShortLivedLoginParams();
API.read(READ_COMMANDS.SIGN_IN_WITH_SHORT_LIVED_AUTH_TOKEN, {authToken, skipReauthentication: true}, {optimisticData, finallyData});
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/LogInWithShortLivedAuthTokenPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import SessionExpiredPage from './ErrorPage/SessionExpiredPage';
type LogInWithShortLivedAuthTokenPageProps = StackScreenProps<PublicScreensParamList, typeof SCREENS.TRANSITION_BETWEEN_APPS>;

function LogInWithShortLivedAuthTokenPage({route}: LogInWithShortLivedAuthTokenPageProps) {
const {email = '', shortLivedAuthToken = '', shortLivedToken = '', authTokenType, exitTo, error} = route?.params ?? {};
const {shortLivedAuthToken = '', shortLivedToken = '', authTokenType, exitTo, error} = route?.params ?? {};
const [account] = useOnyx(ONYXKEYS.ACCOUNT);

useEffect(() => {
Expand All @@ -37,7 +37,7 @@ function LogInWithShortLivedAuthTokenPage({route}: LogInWithShortLivedAuthTokenP
// Try to authenticate using the shortLivedToken if we're not already trying to load the accounts
if (token && !account?.isLoading) {
Log.info('LogInWithShortLivedAuthTokenPage - Successfully received shortLivedAuthToken. Signing in...');
Session.signInWithShortLivedAuthToken(email, token);
Session.signInWithShortLivedAuthToken(token);
return;
}

Expand Down
3 changes: 1 addition & 2 deletions src/pages/LogOutPreviousUserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ function LogOutPreviousUserPage({session, route, isAccountLoading}: LogOutPrevio
// On Enabling 2FA, authToken stored in Onyx becomes expired and hence we need to fetch new authToken
const shouldForceLogin = route.params.shouldForceLogin === 'true';
if (shouldForceLogin) {
const email = route.params.email ?? '';
const shortLivedAuthToken = route.params.shortLivedAuthToken ?? '';
SessionActions.signInWithShortLivedAuthToken(email, shortLivedAuthToken);
SessionActions.signInWithShortLivedAuthToken(shortLivedAuthToken);
}
// We only want to run this effect once on mount (when the page first loads after transitioning from OldDot)
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
Expand Down
2 changes: 1 addition & 1 deletion src/pages/signin/SAMLSignInPage/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function SAMLSignInPage({credentials, account}: SAMLSignInPageProps) {
const shortLivedAuthToken = searchParams.get('shortLivedAuthToken');
if (!account?.isLoading && credentials?.login && !!shortLivedAuthToken) {
Log.info('SAMLSignInPage - Successfully received shortLivedAuthToken. Signing in...');
Session.signInWithShortLivedAuthToken(credentials.login, shortLivedAuthToken);
Session.signInWithShortLivedAuthToken(shortLivedAuthToken);
}

// If the login attempt is unsuccessful, set the error message for the account and redirect to sign in page
Expand Down

0 comments on commit 1ab2d64

Please sign in to comment.