瀏覽代碼

small update

Jared Norris 8 年之前
父節點
當前提交
e6da250d6c
共有 2 個檔案被更改,包括 3 行新增8 行删除
  1. 3
    3
      VueApp/src/App.vue
  2. 0
    5
      VueApp/src/auth/AuthService.js

+ 3
- 3
VueApp/src/App.vue 查看文件

@@ -3,7 +3,7 @@
3 3
     <nav class="navbar navbar-default">
4 4
       <div class="container-fluid">
5 5
         <div class="navbar-header">
6
-          <a class="navbar-brand" href="#">Auth0 - Vue</a>
6
+          <a class="navbar-brand" href="#">Potential Energy</a>
7 7
 
8 8
           <router-link :to="'/'"
9 9
             class="btn btn-primary btn-margin">
@@ -31,8 +31,8 @@
31 31
     </nav>
32 32
 
33 33
     <div class="container">
34
-      <router-view 
35
-        :auth="auth" 
34
+      <router-view
35
+        :auth="auth"
36 36
         :authenticated="authenticated">
37 37
       </router-view>
38 38
     </div>

+ 0
- 5
VueApp/src/auth/AuthService.js 查看文件

@@ -41,7 +41,6 @@ export default class AuthService {
41 41
   }
42 42
 
43 43
   setSession (authResult) {
44
-    // Set the time that the access token will expire at
45 44
     let expiresAt = JSON.stringify(
46 45
       authResult.expiresIn * 1000 + new Date().getTime()
47 46
     )
@@ -52,19 +51,15 @@ export default class AuthService {
52 51
   }
53 52
 
54 53
   logout () {
55
-    // Clear access token and ID token from local storage
56 54
     localStorage.removeItem('access_token')
57 55
     localStorage.removeItem('id_token')
58 56
     localStorage.removeItem('expires_at')
59 57
     this.userProfile = null
60 58
     this.authNotifier.emit('authChange', false)
61
-    // navigate to the home route
62 59
     router.replace('home')
63 60
   }
64 61
 
65 62
   isAuthenticated () {
66
-    // Check whether the current time is past the
67
-    // access token's expiry time
68 63
     let expiresAt = JSON.parse(localStorage.getItem('expires_at'))
69 64
     return new Date().getTime() < expiresAt
70 65
   }