即使声明为真,如果/其他不起作用,则把手

时间:2019-03-31 11:30:16

标签: handlebars.js express-handlebars

为什么Handlebars不能检查“ Custom Claims Admin”是否为true,所以即使自定义声明的语句为true,它也会自动转到else语句。随附CustomClaims的照片。
The admin:true is under metadata thats why i linked it as metadata.customClaims.admin

                  {{#each listusersarray}}
              <tr>
                   <td>{{email}}</td>
                   <td>{{metadata.lastSignInTime}}</td>

              <td>{{#if metadata.customClaims.admin}}Admin{{else}}User{{/if}}</td>

             <td>
              {{!-- <input type="hidden" value="{{uid}}" id="user-uid"> --}}
              {{#if disabled}}
              <button class="btn btn-success " type="button" onclick="enableaccountFunction('{{uid}}')">Enable Account</button>
              {{else}}
              <button class="btn btn-danger " type="button" onclick="disableaccountFunction('{{uid}}')">Disable Account</button>
              {{/if }}
              <input type="hidden" value="{{email}}" id="admin-email">
              <button class="btn btn-primary " onclick="makeadminFunction('{{uid}}')">Make Admin</button>
            </td>



              </tr>
            {{/each}}

1 个答案:

答案 0 :(得分:0)

我不好的customClaims不在元数据之下,这就是为什么未定义其唯一的customClaims.admin