Wall Street was thrilled with the latest operating update from Okta (OKTA 2.20%). The cybersecurity specialist beat growth expectations despite weakening IT spending in many markets. Cost cuts are helping push Okta back toward profitability and at a much faster pace, too.

But there are still some big risks involved with owning this stock. Let's take a look at the biggest one, along with a few good reasons to buy Okta shares now.

Reason to buy: Profitability is on the way

Okta just went a long way toward erasing one of Wall Street's biggest worries: that losses would continue well into the future. This fear was heightened when the company announced back in late August that non-GAAP (adjusted) operating losses were $15 million, or 3% of sales. The company at the time projected losses on this basis of over $100 million for the full year. The picture looked even worse for losses calculated in terms of generally accepted accounting principles (GAAP), which were near $500 million through the first half of fiscal 2023.

Okta isn't on such a bad path anymore, though. The company just boosted its earnings outlook for fiscal 2023, forecasting operating losses of around $41 million rather than the $108 million loss executives had projected back in late August. If it keeps up this turnaround, it could return to profitability by next year. Cost cuts are making the business much more efficient, which implies higher earnings ahead.

Reason to buy: The wider portfolio

Okta's purchase of Auth0 disrupted the business in a few major ways, including by adding some surprise costs while boosting employee turnover. But the company is fixing those integration issues management said in a recent conference call.

Meanwhile, the purchase made Okta a more attractive option for enterprises looking to have more of their identity management and cybersecurity needs met by just one provider. Okta gained 215 large customers last quarter. Management classifies large customers as those with contracts worth over $100,000 per year. Year over year, that key metric was up 32%.

Reason to sell: More short-term difficulty ahead

While they are bullish about the long term, Okta's management team is bracing for a difficult few quarters ahead. The Auth0 integration will require more time and adjustments before it becomes a clear contributor to sales and earnings growth. That challenge is being amplified by slowing economic growth, too. CEO Todd McKinnon recently told investors that executives believe the selling environment will get worse before it improves. A recession threatens to pressure sales while making it harder for Okta to reestablish profitability.

The good news is that these are short-term problems. Okta still has a huge addressable market it can attack in the software-as-a-service space. Its recent success with rising contract sizes shows how it can steadily grow sales by building on its platform.

"Wait and see" seems prudent in 2023

Investors worried about the short-term risks might prefer to wait for more clarity, especially on the integration of the Auth0 products. Okta's earnings potential will be more obvious by mid-2023 when the platform will be better established.

On the other hand, you'll get a big discount for owning the shares during this period of elevated pessimism. Okta is trading for less than 6 times annual sales, or just a fraction of its valuation in early 2022.

The best reason for this discount is the fact that Okta is unprofitable, and that's a big risk heading into a potential recession. But look for that negative factor to lessen in significance over the next several quarters.