aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/root-helpers/users
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-12 16:09:02 +0200
committerChocobozzz <chocobozzz@cpy.re>2022-10-24 14:48:24 +0200
commit3545e72c686ff1725bbdfd8d16d693e2f4aa75a3 (patch)
treee7f1d12ef5dae1e1142c3a8d0b681c1dbbb0de10 /client/src/root-helpers/users
parent38a3ccc7f8ad0ea94362b58c732af7c387ab46be (diff)
downloadPeerTube-3545e72c686ff1725bbdfd8d16d693e2f4aa75a3.tar.gz
PeerTube-3545e72c686ff1725bbdfd8d16d693e2f4aa75a3.tar.zst
PeerTube-3545e72c686ff1725bbdfd8d16d693e2f4aa75a3.zip
Put private videos under a specific subdirectory
Diffstat (limited to 'client/src/root-helpers/users')
-rw-r--r--client/src/root-helpers/users/index.ts2
-rw-r--r--client/src/root-helpers/users/oauth-user-tokens.ts (renamed from client/src/root-helpers/users/user-tokens.ts)8
2 files changed, 5 insertions, 5 deletions
diff --git a/client/src/root-helpers/users/index.ts b/client/src/root-helpers/users/index.ts
index 2b11d0b7e..c03e67325 100644
--- a/client/src/root-helpers/users/index.ts
+++ b/client/src/root-helpers/users/index.ts
@@ -1,2 +1,2 @@
1export * from './user-local-storage-keys' 1export * from './user-local-storage-keys'
2export * from './user-tokens' 2export * from './oauth-user-tokens'
diff --git a/client/src/root-helpers/users/user-tokens.ts b/client/src/root-helpers/users/oauth-user-tokens.ts
index a6d614cb7..a24e76b91 100644
--- a/client/src/root-helpers/users/user-tokens.ts
+++ b/client/src/root-helpers/users/oauth-user-tokens.ts
@@ -1,11 +1,11 @@
1import { UserTokenLocalStorageKeys } from './user-local-storage-keys' 1import { UserTokenLocalStorageKeys } from './user-local-storage-keys'
2 2
3export class UserTokens { 3export class OAuthUserTokens {
4 accessToken: string 4 accessToken: string
5 refreshToken: string 5 refreshToken: string
6 tokenType: string 6 tokenType: string
7 7
8 constructor (hash?: Partial<UserTokens>) { 8 constructor (hash?: Partial<OAuthUserTokens>) {
9 if (hash) { 9 if (hash) {
10 this.accessToken = hash.accessToken 10 this.accessToken = hash.accessToken
11 this.refreshToken = hash.refreshToken 11 this.refreshToken = hash.refreshToken
@@ -25,14 +25,14 @@ export class UserTokens {
25 25
26 if (!accessTokenLocalStorage || !refreshTokenLocalStorage || !tokenTypeLocalStorage) return null 26 if (!accessTokenLocalStorage || !refreshTokenLocalStorage || !tokenTypeLocalStorage) return null
27 27
28 return new UserTokens({ 28 return new OAuthUserTokens({
29 accessToken: accessTokenLocalStorage, 29 accessToken: accessTokenLocalStorage,
30 refreshToken: refreshTokenLocalStorage, 30 refreshToken: refreshTokenLocalStorage,
31 tokenType: tokenTypeLocalStorage 31 tokenType: tokenTypeLocalStorage
32 }) 32 })
33 } 33 }
34 34
35 static saveToLocalStorage (localStorage: Pick<Storage, 'setItem'>, tokens: UserTokens) { 35 static saveToLocalStorage (localStorage: Pick<Storage, 'setItem'>, tokens: OAuthUserTokens) {
36 localStorage.setItem(UserTokenLocalStorageKeys.ACCESS_TOKEN, tokens.accessToken) 36 localStorage.setItem(UserTokenLocalStorageKeys.ACCESS_TOKEN, tokens.accessToken)
37 localStorage.setItem(UserTokenLocalStorageKeys.REFRESH_TOKEN, tokens.refreshToken) 37 localStorage.setItem(UserTokenLocalStorageKeys.REFRESH_TOKEN, tokens.refreshToken)
38 localStorage.setItem(UserTokenLocalStorageKeys.TOKEN_TYPE, tokens.tokenType) 38 localStorage.setItem(UserTokenLocalStorageKeys.TOKEN_TYPE, tokens.tokenType)