Skip to content

Commit

Permalink
hide apiKey in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ledchig committed Jul 8, 2024
1 parent fea176c commit a0c82e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
6 changes: 2 additions & 4 deletions src/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { getAuth } from "firebase/auth"

const firebaseConfig = {

apiKey: "AIzaSyCvgjDwx-IkME7BzVSpEgp98H4c4vyIj1o",
apiKey: `${process.env.API_KEY}`,

authDomain: "test-career-workshop.firebaseapp.com",

Expand All @@ -38,6 +38,4 @@ const app = initializeApp(firebaseConfig)

const auth = getAuth(app)

const apiKey = 'AIzaSyCvgjDwx-IkME7BzVSpEgp98H4c4vyIj1o'

export { auth, apiKey }
export { auth }
11 changes: 4 additions & 7 deletions src/shared/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import axios from 'axios'
import { apiKey } from '../../firebase'

const API_URL = 'https://identitytoolkit.googleapis.com/v1/accounts:'

const signUp = async (email: string, password: string) => {
try {
await axios.post(`${API_URL}signUp?key=${apiKey}`, {
await axios.post(`${process.env.API_URL}signUp?key=${process.env.API_KEY}`, {
email: email,
password: password,
returnSecureToken: true,
Expand All @@ -19,7 +16,7 @@ const signIn = async (email: string, password: string) => {
try {
const {
data: { idToken },
} = await axios.post(`${API_URL}signInWithPassword?key=${apiKey}`, {
} = await axios.post(`${process.env.API_URL}signInWithPassword?key=${process.env.API_KEY}`, {
email: email,
password: password,
returnSecureToken: true,
Expand All @@ -33,7 +30,7 @@ const signIn = async (email: string, password: string) => {

const changeEmail = async (idToken: string, email: string) => {
try {
const resSetEmail = await axios.post(`${API_URL}update?key=${apiKey}`, {
const resSetEmail = await axios.post(`${process.env.API_URL}update?key=${process.env.API_KEY}`, {
idToken: idToken,
email: email,
returnSecureToken: true,
Expand All @@ -46,7 +43,7 @@ const changeEmail = async (idToken: string, email: string) => {

const changePassword = async (idToken: string, password: string) => {
try {
const resSetPass = await axios.post(`${API_URL}update?key=${apiKey}`, {
const resSetPass = await axios.post(`${process.env.API_URL}update?key=${process.env.API_KEY}`, {
idToken: idToken,
password: password,
returnSecureToken: true,
Expand Down

0 comments on commit a0c82e9

Please sign in to comment.