FEATURE: add iam details to admin user page
This commit is contained in:
Родитель
9985b7c043
Коммит
24788c53d0
|
@ -0,0 +1,26 @@
|
|||
<section class='details'>
|
||||
<h1>Mozilla IAM</h1>
|
||||
|
||||
<div class='display-row'>
|
||||
<div class='field'>User ID</div>
|
||||
<div class='value'>
|
||||
{{#if model.mozilla_iam.uid}}
|
||||
{{model.mozilla_iam.uid}}
|
||||
{{else}}
|
||||
—
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='display-row'>
|
||||
<div class='field'>Last Refresh</div>
|
||||
<div class='value'>
|
||||
{{#if model.mozilla_iam.last_refresh}}
|
||||
{{model.mozilla_iam.last_refresh}}
|
||||
{{else}}
|
||||
—
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
12
plugin.rb
12
plugin.rb
|
@ -22,3 +22,15 @@ auth_provider(title: 'Mozilla',
|
|||
message: 'Log In / Sign Up',
|
||||
authenticator: MozillaIAM::Authenticator.new('auth0', trusted: true),
|
||||
full_screen_login: true)
|
||||
|
||||
after_initialize do
|
||||
|
||||
add_to_serializer(:AdminDetailedUser, :mozilla_iam, false) do
|
||||
object.custom_fields.select do |k, v|
|
||||
k.start_with?('mozilla_iam')
|
||||
end.map do |k, v|
|
||||
[k.sub('mozilla_iam_', ''), v]
|
||||
end.to_h
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче