You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Disable or hide the MFA link in the nav bar if MFA isn't enabled #407
@dantownsend I don't know if this is a good approach, but in my opinion this is the simplest way to add an MFA status for the enable/disable link in the navbar. Branch is here
I thought about adding an attribute to the /api/user/ endpoint, but that felt like a hack.
We can't reuse the meta endpoint, because that's public, and we don't want to disclose whether MFA is enabled publicly.
I see you created an endpoint like this:
defget_mfa_status(self) ->JSONResponse:
""" Returns the status of MFA providers. """returnJSONResponse(
{"mfa_enabled": Trueifself.mfa_providerselseFalse}
)
Which I think is good. I'm just weighing up if it's worth doing this:
defget_mfa_providers(self) ->JSONResponse:
""" Returns the names of MFA providers. """returnJSONResponse(
[{"name": provider.name} forproviderinproviders]
)
And we mount it as /api/mfa, so we have the foundations of some Restful endpoints, which we can build upon in the future if needed.
What do you think?
And then in the Vue code, we make sure that the length of the providers is > 0.
Or, we always the show the link, and it links to a page which lists all of the providers. If there are no providers, we say something like 'MFA isn't currently enabled - speak to your admin to set it up'.
Just trying to think if we can 'kill two birds with one stone', and solve the problem of multiple MFA providers at the same time.
I like both of your ideas and know you will find the optimal solution. If you find something useful in the branch from the previous comment, feel free to use it.
Activity
sinisaos commentedon Sep 9, 2024
@dantownsend I don't know if this is a good approach, but in my opinion this is the simplest way to add an MFA status for the enable/disable link in the navbar. Branch is here
dantownsend commentedon Sep 9, 2024
@sinisaos It's a good idea.
I thought about adding an attribute to the
/api/user/endpoint, but that felt like a hack.We can't reuse the
metaendpoint, because that's public, and we don't want to disclose whether MFA is enabled publicly.I see you created an endpoint like this:
Which I think is good. I'm just weighing up if it's worth doing this:
And we mount it as
/api/mfa, so we have the foundations of some Restful endpoints, which we can build upon in the future if needed.What do you think?
And then in the Vue code, we make sure that the length of the providers is > 0.
dantownsend commentedon Sep 9, 2024
Or, we always the show the link, and it links to a page which lists all of the providers. If there are no providers, we say something like 'MFA isn't currently enabled - speak to your admin to set it up'.
Just trying to think if we can 'kill two birds with one stone', and solve the problem of multiple MFA providers at the same time.
sinisaos commentedon Sep 9, 2024
I like both of your ideas and know you will find the optimal solution. If you find something useful in the branch from the previous comment, feel free to use it.