I need to create an spfx extension to redirect the user to the home page if the user has not enough permission. But in the extension after the page loads it starts checking and after that it redirects him which takes around 6-7 secs which is a good significant amount of time. Can anyone suggest if there is any way the spfx extension is called before the page loads it would work.

Please let me know if any such way is possible or not.

1 Answer 1


SPFx Extension runs almost at the very last moment after the page was served to the browser. Therefore, using SFPx extension is probably not going to be viable for what you are trying to do.

Perhaps, you could implement it this way:

  • Create an SPFx webpart.
  • Add it to the page that everyone has access to.
  • The SPFx webpart will check if the user has access to the target page. If a user has access to the target page then show a button. Otherwise show nothing or something else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.