Skip to content

Commit

Permalink
fix: providers (#1835)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivalaakam authored Mar 26, 2024
1 parent 3dd3802 commit bff2739
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,7 @@ google-account.json
artifacts/*

# react-native-config codegen
ios/tmp.xcconfig
ios/tmp.xcconfig

.direnv
.devenv
10 changes: 7 additions & 3 deletions src/contexts/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,20 @@ class App extends AsyncEventEmitter {

get isGoogleSigninSupported() {
return (
Boolean(RemoteConfig.get('sss_google')) && this._googleSigninSupported
Boolean(RemoteConfig.get('sss_google_provider')) &&
this._googleSigninSupported
);
}

get isAppleSigninSupported() {
return Boolean(RemoteConfig.get('sss_apple')) && this._appleSigninSupported;
return (
Boolean(RemoteConfig.get('sss_apple_provider')) &&
this._appleSigninSupported
);
}

get isCustomSigninSupported() {
return Boolean(RemoteConfig.get('sss_custom'));
return Boolean(RemoteConfig.get('sss_custom_provider'));
}

get isOathSigninSupported() {
Expand Down
6 changes: 3 additions & 3 deletions src/services/provider-sss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function onLoginCustom() {
const authState = await getHttpResponse(token);

const authInfo = parseJwt(authState.idToken);
const verifier = RemoteConfig.get('sss_custom');
const verifier = RemoteConfig.get('sss_custom_provider');

if (!verifier) {
throw new Error('sss_custom is not set');
Expand All @@ -67,7 +67,7 @@ export async function onLoginGoogle() {
}
const authInfo = parseJwt(authState.idToken);

const verifier = RemoteConfig.get('sss_google');
const verifier = RemoteConfig.get('sss_google_provider');

if (!verifier) {
// Logger.log('SSS_GOOGLE_ERROR', 'sss_google is not set');
Expand All @@ -91,7 +91,7 @@ export async function onLoginApple() {

const authInfo = parseJwt(identityToken);

const verifier = RemoteConfig.get('sss_apple');
const verifier = RemoteConfig.get('sss_apple_provider');

if (!verifier) {
throw new Error('sss_apple is not set');
Expand Down
6 changes: 3 additions & 3 deletions src/services/remote-config/remote-config-default-values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ export const REMOTE_CONFIG_DEFAULT_VALUES: Required<RemoteConfigTypes> = {
ios_version: getAppVersion(),
android_version: getAppVersion(),
welcome_screen: 'welcomeNews',
sss_google: 'haqq-google-ios',
sss_apple: 'haqq-apple',
sss_custom: undefined,
sss_google_provider: 'haqq-google-ios',
sss_apple_provider: 'haqq-apple',
sss_custom_provider: undefined,
sss_custom_url: undefined,
sss_metadata_url: 'https://metadata.social.production.haqq.network',
sss_generate_shares_url:
Expand Down
6 changes: 3 additions & 3 deletions src/services/remote-config/remote-config-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ export type RemoteConfigTypes = RemoteConfigBalanceTypes &
indexer_endpoints: Record<string, string>;
ios_version: string;
pattern_source: string;
sss_apple: string;
sss_custom: string | undefined;
sss_apple_provider: string;
sss_custom_provider: string | undefined;
sss_custom_url: string | undefined;
sss_generate_shares_url: string;
sss_google: string;
sss_google_provider: string;
sss_metadata_url: string;
tm_endpoints: Record<string, string[]>;
version: number;
Expand Down

0 comments on commit bff2739

Please sign in to comment.