Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k views
in Technique[技术] by (71.8m points)

spartacus storefront - Override AuthGuard to require login from a 3rd party

What is the correct/best way of overriding the Spartacus AuthGuard with MsalGuard for example?

Should I just override it like a service or do I need to extend from it and change it?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It depends on the use case, extending makes sense if you want to reuse or build on top of the existing logic, which results in a better upgradability for most of the cases.

But in general, both should work OK, as you will end up with the new class that you'll have to provide as AuthGuard.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...