Skip to content

Commit

Permalink
Tidy (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
NigelBreslaw authored Feb 15, 2024
1 parent cb436c0 commit af2d1f9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion native_gg/src/account/Account.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as v from "valibot";
import { apiKey } from "../constants/env.ts";
import { RefreshToken } from "../authentication/Types.ts";
import { RefreshToken } from "../authentication/Utilities.ts";

const PlatformSilverSchema = v.object({
itemHash: v.number(),
Expand Down
3 changes: 1 addition & 2 deletions native_gg/src/authentication/AuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +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 } from "./Types.ts";
import { getAccessToken, getRefreshToken } from "./Utilities.ts";
import { RefreshToken, refreshTokenSchema, getAccessToken, getRefreshToken } from "./Utilities.ts";
import {
BungieUser,
BungieUserSchema,
Expand Down
13 changes: 0 additions & 13 deletions native_gg/src/authentication/Types.ts

This file was deleted.

13 changes: 12 additions & 1 deletion native_gg/src/authentication/Utilities.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import * as base64 from "base-64";
import * as v from "valibot";
import { apiKey, clientID, clientSecret } from "../constants/env.ts";
import { RefreshToken, refreshTokenSchema } from "./Types.ts";

export const refreshTokenSchema = v.object({
access_token: v.string(),
expires_in: v.number(),
membership_id: v.string(),
refresh_expires_in: v.number(),
refresh_token: v.string(),
time_stamp: v.optional(v.string([v.isoTimestamp()])),
token_type: v.string(),
});

export type RefreshToken = v.Output<typeof refreshTokenSchema>;

export function getRefreshToken(bungieCode: string): Promise<JSON> {
const headers = new Headers();
Expand Down

0 comments on commit af2d1f9

Please sign in to comment.