| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2017 The LUCI Authors. All rights reserved. | 2 Copyright 2017 The LUCI Authors. All rights reserved. |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | 3 Use of this source code is governed under the Apache License, Version 2.0 |
| 4 that can be found in the LICENSE file. | 4 that can be found in the LICENSE file. |
| 5 | 5 |
| 6 The `auth-signin` element displays sign-in/sign-out button, user email and | 6 The `auth-signin` element displays sign-in/sign-out button, user email and |
| 7 avatar. | 7 avatar. |
| 8 It has a google-signin/google-signin-aware element under the hood that handles | 8 It has a google-signin/google-signin-aware element under the hood that handles |
| 9 the actual OAuth logic. | 9 the actual OAuth logic. |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 client-id="[[client_id]]" | 48 client-id="[[client_id]]" |
| 49 initialized="{{initialized}}" | 49 initialized="{{initialized}}" |
| 50 scopes="email" | 50 scopes="email" |
| 51 on-google-signin-aware-success="_onSignin" | 51 on-google-signin-aware-success="_onSignin" |
| 52 on-google-signin-aware-signed-out="_onSignout"> | 52 on-google-signin-aware-signed-out="_onSignout"> |
| 53 </google-signin-aware> | 53 </google-signin-aware> |
| 54 | 54 |
| 55 <template is="dom-if" if="[[!signed_in]]"> | 55 <template is="dom-if" if="[[!signed_in]]"> |
| 56 <div id="signinContainer"> | 56 <div id="signinContainer"> |
| 57 <!-- TODO(cwpayton): Before official deployment, change href to "/#/" --
> | 57 <!-- TODO(cwpayton): Before official deployment, change href to "/#/" --
> |
| 58 <a class="typeface" on-tap="signIn" href="/newui#/">Sign in</a> | 58 <a class="typeface" on-tap="signIn" href="/#/">Sign in</a> |
| 59 </div> | 59 </div> |
| 60 </template> | 60 </template> |
| 61 | 61 |
| 62 <template is="dom-if" if="[[signed_in]]"> | 62 <template is="dom-if" if="[[signed_in]]"> |
| 63 <img class="center" id="avatar" src="[[profile.imageUrl]]" width="30" heig
ht="30"> | 63 <img class="center" id="avatar" src="[[profile.imageUrl]]" width="30" heig
ht="30"> |
| 64 <span class="center typeface">[[profile.email]]</span> | 64 <span class="center typeface">[[profile.email]]</span> |
| 65 <span class="center typeface">|</span> | 65 <span class="center typeface">|</span> |
| 66 <!-- TODO(cwpayton): Before official deployment, change href to "/#/" --> | 66 <!-- TODO(cwpayton): Before official deployment, change href to "/#/" --> |
| 67 <a class="center typeface" on-tap="signOut" href="/newui#/">Sign out</a> | 67 <a class="center typeface" on-tap="signOut" href="/#/">Sign out</a> |
| 68 </template> | 68 </template> |
| 69 </template> | 69 </template> |
| 70 <script> | 70 <script> |
| 71 'use strict'; | 71 'use strict'; |
| 72 Polymer({ | 72 Polymer({ |
| 73 is: 'auth-signin', | 73 is: 'auth-signin', |
| 74 properties: { | 74 properties: { |
| 75 auth_headers: { | 75 auth_headers: { |
| 76 type: Object, | 76 type: Object, |
| 77 value: () => null, | 77 value: () => null, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 this.$.aware.signIn(); | 168 this.$.aware.signIn(); |
| 169 }, | 169 }, |
| 170 | 170 |
| 171 signOut: function() { | 171 signOut: function() { |
| 172 this.$.aware.signOut(); | 172 this.$.aware.signOut(); |
| 173 window.location.reload(); | 173 window.location.reload(); |
| 174 } | 174 } |
| 175 }); | 175 }); |
| 176 </script> | 176 </script> |
| 177 </dom-module> | 177 </dom-module> |
| OLD | NEW |