Skip to content

Commit

Permalink
isValidAccess -> isValidAccessToken
Browse files Browse the repository at this point in the history
  • Loading branch information
NigelBreslaw committed Feb 17, 2024
1 parent 3973713 commit 36cab0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions native_gg/src/authentication/AuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions native_gg/src/authentication/Utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function getAccessToken(token: RefreshToken): Promise<RefreshToken> {
});
}

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;
Expand All @@ -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;
Expand Down

0 comments on commit 36cab0e

Please sign in to comment.