Skip to content

Commit

Permalink
feat: better logging, updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Chandram-Dutta committed Apr 26, 2024
1 parent 09e56f6 commit 197a971
Show file tree
Hide file tree
Showing 29 changed files with 578 additions and 459 deletions.
2 changes: 1 addition & 1 deletion VITTY/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct ContentView: View {
var body: some View {
NavigationView {
if authViewModel.loggedInFirebaseUser != nil {
if authViewModel.appUser == nil {
if authViewModel.loggedInBackendUser == nil {
InstructionView()
}
else {
Expand Down
62 changes: 32 additions & 30 deletions VITTY/VITTY.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@
525AA7A92B4B0164003C6A12 /* SearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525AA7A82B4B0164003C6A12 /* SearchView.swift */; };
525F759D2B809F8400E3B418 /* LectureDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525F759C2B809F8400E3B418 /* LectureDetailView.swift */; };
527E3E082B7662920086F23D /* TimeTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 527E3E072B7662920086F23D /* TimeTableView.swift */; };
528CF16E2B769A84007298A0 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 528CF16D2B769A84007298A0 /* GoogleService-Info.plist */; };
528CF1732B769B18007298A0 /* TimeTable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 528CF1722B769B18007298A0 /* TimeTable.swift */; };
528CF1762B769E22007298A0 /* TimeTableViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 528CF1752B769E22007298A0 /* TimeTableViewModel.swift */; };
528CF1782B769E64007298A0 /* TimeTableAPIService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 528CF1772B769E64007298A0 /* TimeTableAPIService.swift */; };
52A81F992BD9F42500AED9B7 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 52A81F982BD9F42500AED9B7 /* GoogleService-Info.plist */; };
52A81F9B2BD9F42B00AED9B7 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 52A81F9A2BD9F42A00AED9B7 /* GoogleService-Info.plist */; };
52D5AB862B6FE2ED00B2E66D /* AuthViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52D5AB852B6FE2ED00B2E66D /* AuthViewModel.swift */; };
52D5AB892B6FE3B200B2E66D /* AppUser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52D5AB882B6FE3B200B2E66D /* AppUser.swift */; };
52D5AB8C2B6FE4D600B2E66D /* UserDefaultKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52D5AB8B2B6FE4D500B2E66D /* UserDefaultKeys.swift */; };
Expand Down Expand Up @@ -178,11 +179,11 @@
525AA7A82B4B0164003C6A12 /* SearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchView.swift; sourceTree = "<group>"; };
525F759C2B809F8400E3B418 /* LectureDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LectureDetailView.swift; sourceTree = "<group>"; };
527E3E072B7662920086F23D /* TimeTableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeTableView.swift; sourceTree = "<group>"; };
528CF16D2B769A84007298A0 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../../../../Downloads/GoogleService-Info.plist"; sourceTree = "<group>"; };
528CF16F2B769A89007298A0 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../../../../Downloads/GoogleService-Info.plist"; sourceTree = "<group>"; };
528CF1722B769B18007298A0 /* TimeTable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeTable.swift; sourceTree = "<group>"; };
528CF1752B769E22007298A0 /* TimeTableViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeTableViewModel.swift; sourceTree = "<group>"; };
528CF1772B769E64007298A0 /* TimeTableAPIService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeTableAPIService.swift; sourceTree = "<group>"; };
52A81F982BD9F42500AED9B7 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../../../../Downloads/GoogleService-Info.plist"; sourceTree = "<group>"; };
52A81F9A2BD9F42A00AED9B7 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../../../../Downloads/GoogleService-Info.plist"; sourceTree = "<group>"; };
52D5AB852B6FE2ED00B2E66D /* AuthViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthViewModel.swift; sourceTree = "<group>"; };
52D5AB882B6FE3B200B2E66D /* AppUser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppUser.swift; sourceTree = "<group>"; };
52D5AB8B2B6FE4D500B2E66D /* UserDefaultKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultKeys.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -335,14 +336,14 @@
314A408D27383BEC0058082F /* VITTY */ = {
isa = PBXGroup;
children = (
52A81F952BD9F41300AED9B7 /* Firebase */,
527E3E022B76626A0086F23D /* TimeTable */,
521562A92B70B0E50054F051 /* Instruction */,
52D5AB8A2B6FE4C600B2E66D /* Shared */,
5D3D92502A1816CC0013803E /* Username */,
5D1FF2632A32643400B0620A /* Settings */,
524B842C2B46EBA6006D18BD /* Home */,
524B84302B46EF07006D18BD /* Circle */,
52DC41DF2B6F8B1500CCF8DB /* Firebase */,
52CC87082B677FCC0030B7E9 /* Auth */,
31128CF02772F0210084C9EA /* Info.plist */,
314A40A127383C0A0058082F /* Utilities */,
Expand Down Expand Up @@ -624,6 +625,31 @@
path = Models;
sourceTree = "<group>";
};
52A81F952BD9F41300AED9B7 /* Firebase */ = {
isa = PBXGroup;
children = (
52A81F972BD9F41E00AED9B7 /* Prod */,
52A81F962BD9F41A00AED9B7 /* Dev */,
);
path = Firebase;
sourceTree = "<group>";
};
52A81F962BD9F41A00AED9B7 /* Dev */ = {
isa = PBXGroup;
children = (
52A81F9A2BD9F42A00AED9B7 /* GoogleService-Info.plist */,
);
path = Dev;
sourceTree = "<group>";
};
52A81F972BD9F41E00AED9B7 /* Prod */ = {
isa = PBXGroup;
children = (
52A81F982BD9F42500AED9B7 /* GoogleService-Info.plist */,
);
path = Prod;
sourceTree = "<group>";
};
52CC87082B677FCC0030B7E9 /* Auth */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -678,31 +704,6 @@
path = Views;
sourceTree = "<group>";
};
52DC41DF2B6F8B1500CCF8DB /* Firebase */ = {
isa = PBXGroup;
children = (
52DC41E12B6F8B2100CCF8DB /* Prod */,
52DC41E02B6F8B1E00CCF8DB /* Dev */,
);
path = Firebase;
sourceTree = "<group>";
};
52DC41E02B6F8B1E00CCF8DB /* Dev */ = {
isa = PBXGroup;
children = (
528CF16F2B769A89007298A0 /* GoogleService-Info.plist */,
);
path = Dev;
sourceTree = "<group>";
};
52DC41E12B6F8B2100CCF8DB /* Prod */ = {
isa = PBXGroup;
children = (
528CF16D2B769A84007298A0 /* GoogleService-Info.plist */,
);
path = Prod;
sourceTree = "<group>";
};
5D1FF2632A32643400B0620A /* Settings */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -866,7 +867,8 @@
31128CF92772F57E0084C9EA /* Poppins-Medium.ttf in Resources */,
31128CFA2772F57E0084C9EA /* Poppins-SemiBoldItalic.ttf in Resources */,
31128CFC2772F57E0084C9EA /* Poppins-Regular.ttf in Resources */,
528CF16E2B769A84007298A0 /* GoogleService-Info.plist in Resources */,
52A81F992BD9F42500AED9B7 /* GoogleService-Info.plist in Resources */,
52A81F9B2BD9F42B00AED9B7 /* GoogleService-Info.plist in Resources */,
314A409627383BEE0058082F /* Preview Assets.xcassets in Resources */,
314A409327383BEE0058082F /* Assets.xcassets in Resources */,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,57 +1,58 @@
{
"originHash" : "6f82248712b2a75248927c08ca58128690eff43fddf009041594657c80f6cd6d",
"pins" : [
{
"identity" : "abseil-cpp-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/abseil-cpp-binary.git",
"state" : {
"revision" : "bfc0b6f81adc06ce5121eb23f628473638d67c5c",
"version" : "1.2022062300.0"
"revision" : "748c7837511d0e6a507737353af268484e1745e2",
"version" : "1.2024011601.1"
}
},
{
"identity" : "alamofire",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire.git",
"state" : {
"revision" : "3dc6a42c7727c49bf26508e29b0a0b35f9c7e1ad",
"version" : "5.8.1"
"revision" : "f455c2975872ccd2d9c81594c658af65716e9b9a",
"version" : "5.9.1"
}
},
{
"identity" : "app-check",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/app-check.git",
"state" : {
"revision" : "3e464dad87dad2d29bb29a97836789bf0f8f67d2",
"version" : "10.18.1"
"revision" : "7d2688de038d5484866d835acb47b379722d610e",
"version" : "10.19.0"
}
},
{
"identity" : "appauth-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/openid/AppAuth-iOS.git",
"state" : {
"revision" : "71cde449f13d453227e687458144bde372d30fc7",
"version" : "1.6.2"
"revision" : "c89ed571ae140f8eb1142735e6e23d7bb8c34cb2",
"version" : "1.7.5"
}
},
{
"identity" : "firebase-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : {
"revision" : "f91c8167141d0279726c6f6d9d4a47c026785cbc",
"version" : "10.21.0"
"revision" : "42eae77a0af79e9c3f41df04a23c76f05cfdda77",
"version" : "10.24.0"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "cb8617fab75d181270a1d8f763f26b15c73e2e1e",
"version" : "10.21.0"
"revision" : "51ba746a9d51a4bd0774b68499b0c73ef6e8570d",
"version" : "10.24.0"
}
},
{
Expand All @@ -68,44 +69,44 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleSignIn-iOS",
"state" : {
"revision" : "7932d33686c1dc4d7df7a919aae47361d1cdfda4",
"version" : "7.0.0"
"revision" : "a7965d134c5d3567026c523e0a8a583f73b62b0d",
"version" : "7.1.0"
}
},
{
"identity" : "googleutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "830ffa9276e10267881f2697283c2fcd867603fd",
"version" : "7.13.0"
"revision" : "26c898aed8bed13b8a63057ee26500abbbcb8d55",
"version" : "7.13.1"
}
},
{
"identity" : "grpc-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/grpc-binary.git",
"state" : {
"revision" : "a673bc2937fbe886dd1f99c401b01b6d977a9c98",
"version" : "1.49.1"
"revision" : "e9fad491d0673bdda7063a0341fb6b47a30c5359",
"version" : "1.62.2"
}
},
{
"identity" : "gtm-session-fetcher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "5ccda3981422a84186387dbb763ba739178b529c",
"version" : "2.3.0"
"revision" : "0382ca27f22fb3494cf657d8dc356dc282cd1193",
"version" : "3.4.1"
}
},
{
"identity" : "gtmappauth",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GTMAppAuth.git",
"state" : {
"revision" : "6dee0cde8a1b223737a5159e55e6b4ec16bbbdd9",
"version" : "1.3.1"
"revision" : "5d7d66f647400952b1758b230e019b07c0b4b22a",
"version" : "4.1.1"
}
},
{
Expand All @@ -122,17 +123,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/leveldb.git",
"state" : {
"revision" : "43aaef65e0c665daadf848761d560e446d350d3d",
"version" : "1.22.4"
"revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1",
"version" : "1.22.5"
}
},
{
"identity" : "nanopb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/nanopb.git",
"state" : {
"revision" : "819d0a2173aff699fb8c364b6fb906f7cdb1a692",
"version" : "2.30909.0"
"revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1",
"version" : "2.30910.0"
}
},
{
Expand All @@ -149,8 +150,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41",
"version" : "1.3.0"
"revision" : "46989693916f56d1186bd59ac15124caef896560",
"version" : "1.3.1"
}
},
{
Expand Down Expand Up @@ -185,19 +186,19 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "65e8f29b2d63c4e38e736b25c27b83e012159be8",
"version" : "1.25.2"
"revision" : "9f0c76544701845ad98716f3f6a774a892152bcb",
"version" : "1.26.0"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
"revision" : "64889f0c732f210a935a0ad7cda38f77f876262d",
"version" : "509.1.1"
}
}
],
"version" : 2
"version" : 3
}
6 changes: 3 additions & 3 deletions VITTY/VITTY/Auth/Service/AuthAPIService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ enum AuthAPIServiceError: Error {

class AuthAPIService {
static let shared = AuthAPIService()

func signInUser(
with authRequestBody: AuthRequestBody
) async throws -> AppUser {
Expand All @@ -29,15 +29,15 @@ class AuthAPIService {
let appUser = try decoder.decode(AppUser.self, from: data.0)
return appUser
}

func checkUserExists(with authID: String) async throws -> Bool {
let url = URL(string: "\(Constants.url)auth/check-user-exists")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let encoder = JSONEncoder()
request.httpBody = try encoder.encode(["uuid": authID])
let (data, res) = try await URLSession.shared.data(for: request)
let (_, res) = try await URLSession.shared.data(for: request)
let httpResponse = res as? HTTPURLResponse
return httpResponse?.statusCode == 200
}
Expand Down
Loading

0 comments on commit 197a971

Please sign in to comment.