export const getConnections = (authOptions: WidgetProvider.AuthOptions) => {
	if (authOptions?.connections) {
		for (const [key, value] of Object.entries(authOptions.connections)) {
			if (value === true) {
				switch (key) {
					case 'google-oauth2':
					case 'google':
						authOptions.connections['google'] = 'google-oauth2';
						break;
					case 'password':
						authOptions.connections[
							key as keyof WidgetProvider.AuthOptionsConnections
						] = 'Username-Password-Authentication';
						break;
					default:
						authOptions.connections[
							key as keyof WidgetProvider.AuthOptionsConnections
						] = key;
						break;
				}
			}
		}
	}

	return authOptions;
};
