From 36cab0e5fab21df1b3eca83fec37988a5e287893 Mon Sep 17 00:00:00 2001 From: Nigel Breslaw Date: Sat, 17 Feb 2024 12:00:28 +0200 Subject: [PATCH] isValidAccess -> isValidAccessToken --- native_gg/src/authentication/AuthService.ts | 4 ++-- native_gg/src/authentication/Utilities.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/native_gg/src/authentication/AuthService.ts b/native_gg/src/authentication/AuthService.ts index ad2a3ddb2..e2d913f20 100644 --- a/native_gg/src/authentication/AuthService.ts +++ b/native_gg/src/authentication/AuthService.ts @@ -5,7 +5,7 @@ import * as WebBrowser from "expo-web-browser"; import * as v from "valibot"; import { clientID, redirectURL } from "../constants/env.ts"; import { Store } from "../constants/storage.ts"; -import { RefreshToken, refreshTokenSchema, getAccessToken, getRefreshToken, isValidAccess } from "./Utilities.ts"; +import { RefreshToken, refreshTokenSchema, getAccessToken, getRefreshToken, isValidAccessToken } from "./Utilities.ts"; import { BungieUser, BungieUserSchema, @@ -94,7 +94,7 @@ class AuthService { return new Promise((resolve, reject) => { if (AuthService.instance.authToken) { /// is the access token valid? - const isValid = isValidAccess(AuthService.instance.authToken); + const isValid = isValidAccessToken(AuthService.instance.authToken); if (!isValid) { console.log("Token expired"); getAccessToken(AuthService.instance.authToken) diff --git a/native_gg/src/authentication/Utilities.ts b/native_gg/src/authentication/Utilities.ts index 09b9c46f8..261b9007e 100644 --- a/native_gg/src/authentication/Utilities.ts +++ b/native_gg/src/authentication/Utilities.ts @@ -86,7 +86,7 @@ export function getAccessToken(token: RefreshToken): Promise { }); } -export function isValidAccess(token: RefreshToken): boolean { +export function isValidAccessToken(token: RefreshToken): boolean { // Access lasts 3600 seconds (1 hour) if (token.time_stamp) { const lifeTime = token.expires_in; @@ -100,7 +100,7 @@ export function isValidAccess(token: RefreshToken): boolean { return true; } -export function isValidRefresh(token: RefreshToken): boolean { +export function isValidRefreshToken(token: RefreshToken): boolean { // Refresh lasts 7,776,000 seconds (90 days) if (token.time_stamp) { const lifeTime = token.refresh_expires_in;