mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
Change .spotify to spotify.json
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -110,4 +110,4 @@ dist
|
|||||||
database/seeders
|
database/seeders
|
||||||
build
|
build
|
||||||
|
|
||||||
.spotify
|
spotify.json
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ WORKDIR /usr/src/athena/build
|
|||||||
|
|
||||||
RUN yarn install --production
|
RUN yarn install --production
|
||||||
|
|
||||||
RUN touch .spotify
|
RUN touch spotify.json
|
||||||
|
|
||||||
EXPOSE 5555
|
EXPOSE 5555
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { Artist, InternalPlayerResponse, PlayerResponse, SpotifyToken } from 'Ap
|
|||||||
import Song from 'App/Models/Song'
|
import Song from 'App/Models/Song'
|
||||||
|
|
||||||
export function getSpotifyAccount(): { access: string; refresh: string } {
|
export function getSpotifyAccount(): { access: string; refresh: string } {
|
||||||
return JSON.parse(readFileSync('.spotify').toString())
|
return JSON.parse(readFileSync('spotify.json').toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAuthorizationURI(): string {
|
export function getAuthorizationURI(): string {
|
||||||
@@ -39,7 +39,7 @@ export async function setupSpotify(code: string): Promise<void> {
|
|||||||
|
|
||||||
if (authorization_tokens.status === 200) {
|
if (authorization_tokens.status === 200) {
|
||||||
writeFileSync(
|
writeFileSync(
|
||||||
'.spotify',
|
'spotify.json',
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
access: authorization_tokens.data.access_token,
|
access: authorization_tokens.data.access_token,
|
||||||
refresh: authorization_tokens.data.refresh_token,
|
refresh: authorization_tokens.data.refresh_token,
|
||||||
@@ -67,7 +67,7 @@ export async function regenerateTokens(): Promise<void> {
|
|||||||
|
|
||||||
if (authorization_tokens.status === 200) {
|
if (authorization_tokens.status === 200) {
|
||||||
writeFileSync(
|
writeFileSync(
|
||||||
'.spotify',
|
'spotify.json',
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
access: authorization_tokens.data.access_token,
|
access: authorization_tokens.data.access_token,
|
||||||
refresh: authorization_tokens.data.refresh_token,
|
refresh: authorization_tokens.data.refresh_token,
|
||||||
|
|||||||
Reference in New Issue
Block a user