Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update authentication flow #89

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions ENGAGEHF.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
4D05F26A2C5466B700201581 /* DosageGauge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D05F2692C5466B700201581 /* DosageGauge.swift */; };
4D05F26D2C54696100201581 /* DosageGaugeStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D05F26C2C54696100201581 /* DosageGaugeStyle.swift */; };
4D065BE02C09401700EBB3AE /* StudyApplicationListCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D065BDF2C09401700EBB3AE /* StudyApplicationListCard.swift */; };
4D081A1F2C6C1A3400E13BC8 /* OrganizationInformation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D081A1E2C6C1A3400E13BC8 /* OrganizationInformation.swift */; };
4D081A262C6C2C6B00E13BC8 /* NotificationSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D081A252C6C2C6B00E13BC8 /* NotificationSettings.swift */; };
4D081A1F2C6C1A3400E13BC8 /* Organization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D081A1E2C6C1A3400E13BC8 /* Organization.swift */; };
4D081A282C6C2C8400E13BC8 /* UserMetaDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D081A272C6C2C8400E13BC8 /* UserMetaDataManager.swift */; };
4D0F389E2C09779100DA12F7 /* ShowMoreButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D0F389D2C09779000DA12F7 /* ShowMoreButton.swift */; };
4D0F38A22C0A7AD900DA12F7 /* ExpandableText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D0F38A12C0A7AD900DA12F7 /* ExpandableText.swift */; };
Expand Down Expand Up @@ -202,8 +201,12 @@
9733CFC62A8066DE001B7ABC /* SpeziOnboarding in Frameworks */ = {isa = PBXBuildFile; productRef = 2FE5DC8029EDD91D004B9AB4 /* SpeziOnboarding */; };
9739A0C62AD7B5730084BEA5 /* FirebaseStorage in Frameworks */ = {isa = PBXBuildFile; productRef = 9739A0C52AD7B5730084BEA5 /* FirebaseStorage */; };
97D73D6A2AD860AD00B47FA0 /* SpeziFirebaseStorage in Frameworks */ = {isa = PBXBuildFile; productRef = 97D73D692AD860AD00B47FA0 /* SpeziFirebaseStorage */; };
9B1864882C9226E90042AC81 /* AccountDetails+Key.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B1864872C9226E90042AC81 /* AccountDetails+Key.swift */; };
9B18648B2C9227040042AC81 /* AccountNotifications+Extras.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18648A2C9227040042AC81 /* AccountNotifications+Extras.swift */; };
9B1864942C9276C40042AC81 /* AuthFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B1864932C9276C40042AC81 /* AuthFlow.swift */; };
9B1864982C9350D30042AC81 /* Account+Binding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B1864972C9350D30042AC81 /* Account+Binding.swift */; };
9B9C21E02C89389900FE1430 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B9C21DF2C89389900FE1430 /* ContentView.swift */; };
A9623C042C17A3F500189BA1 /* SpeziOmron in Frameworks */ = {isa = PBXBuildFile; productRef = A9623C032C17A3F500189BA1 /* SpeziOmron */; };
A9623C082C18D03F00189BA1 /* AccountSetupSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9623C072C18D03F00189BA1 /* AccountSetupSheet.swift */; };
A96C56BB2C0DFFCE00D6A50B /* InvitationCodeModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = A96C56BA2C0DFFCE00D6A50B /* InvitationCodeModule.swift */; };
A9720E432ABB68CC00872D23 /* AccountSetupHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9720E422ABB68CC00872D23 /* AccountSetupHeader.swift */; };
A977DD542C25E2DA00A2A8E5 /* SpeziDevices in Frameworks */ = {isa = PBXBuildFile; productRef = A977DD532C25E2DA00A2A8E5 /* SpeziDevices */; };
Expand Down Expand Up @@ -257,8 +260,7 @@
4D05F2692C5466B700201581 /* DosageGauge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DosageGauge.swift; sourceTree = "<group>"; };
4D05F26C2C54696100201581 /* DosageGaugeStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DosageGaugeStyle.swift; sourceTree = "<group>"; };
4D065BDF2C09401700EBB3AE /* StudyApplicationListCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudyApplicationListCard.swift; sourceTree = "<group>"; };
4D081A1E2C6C1A3400E13BC8 /* OrganizationInformation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrganizationInformation.swift; sourceTree = "<group>"; };
4D081A252C6C2C6B00E13BC8 /* NotificationSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSettings.swift; sourceTree = "<group>"; };
4D081A1E2C6C1A3400E13BC8 /* Organization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Organization.swift; sourceTree = "<group>"; };
4D081A272C6C2C8400E13BC8 /* UserMetaDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserMetaDataManager.swift; sourceTree = "<group>"; };
4D0F389D2C09779000DA12F7 /* ShowMoreButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowMoreButton.swift; sourceTree = "<group>"; };
4D0F38A12C0A7AD900DA12F7 /* ExpandableText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExpandableText.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -409,7 +411,11 @@
653A256128338800005D4D48 /* VitalsGraphAggregationUnitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VitalsGraphAggregationUnitTests.swift; sourceTree = "<group>"; };
653A256728338800005D4D48 /* ENGAGEHFUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ENGAGEHFUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
653A258928339462005D4D48 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A9623C072C18D03F00189BA1 /* AccountSetupSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountSetupSheet.swift; sourceTree = "<group>"; };
9B1864872C9226E90042AC81 /* AccountDetails+Key.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AccountDetails+Key.swift"; sourceTree = "<group>"; };
9B18648A2C9227040042AC81 /* AccountNotifications+Extras.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AccountNotifications+Extras.swift"; sourceTree = "<group>"; };
9B1864932C9276C40042AC81 /* AuthFlow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthFlow.swift; sourceTree = "<group>"; };
9B1864972C9350D30042AC81 /* Account+Binding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Account+Binding.swift"; sourceTree = "<group>"; };
9B9C21DF2C89389900FE1430 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
A96C56BA2C0DFFCE00D6A50B /* InvitationCodeModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitationCodeModule.swift; sourceTree = "<group>"; };
A9720E422ABB68CC00872D23 /* AccountSetupHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountSetupHeader.swift; sourceTree = "<group>"; };
A9DFE8A82ABE551400428242 /* AccountButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountButton.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -493,6 +499,7 @@
isa = PBXGroup;
children = (
2FE5DC3129EDD7CA004B9AB4 /* OnboardingFlow.swift */,
9B1864932C9276C40042AC81 /* AuthFlow.swift */,
2FE5DC3429EDD7CA004B9AB4 /* Welcome.swift */,
2FE5DC3229EDD7CA004B9AB4 /* InterestingModules.swift */,
2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */,
Expand Down Expand Up @@ -566,8 +573,7 @@
4D081A242C6C2C4500E13BC8 /* UserMetaDataManager */ = {
isa = PBXGroup;
children = (
4D081A1E2C6C1A3400E13BC8 /* OrganizationInformation.swift */,
4D081A252C6C2C6B00E13BC8 /* NotificationSettings.swift */,
4D081A1E2C6C1A3400E13BC8 /* Organization.swift */,
4D081A272C6C2C8400E13BC8 /* UserMetaDataManager.swift */,
);
path = UserMetaDataManager;
Expand Down Expand Up @@ -856,6 +862,9 @@
4D70CF642C653BE100EB4CC6 /* Image+CardSymbolStyle.swift */,
4DF36FF82C66A884004D737A /* String+Identifiable.swift */,
4D62BF3F2C6AB8520088C414 /* KeyedDecodingContainer+DecodeISO8601Date.swift */,
9B1864872C9226E90042AC81 /* AccountDetails+Key.swift */,
9B18648A2C9227040042AC81 /* AccountNotifications+Extras.swift */,
9B1864972C9350D30042AC81 /* Account+Binding.swift */,
);
path = SharedExtensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -1009,6 +1018,7 @@
2F5E32BC297E05EA003432F8 /* ENGAGEHFDelegate.swift */,
2FF53D8C2A8729D600042B76 /* ENGAGEHFStandard.swift */,
2F4E23822989D51F0013F3D9 /* ENGAGEHFTestingSetup.swift */,
9B9C21DF2C89389900FE1430 /* ContentView.swift */,
2FC975A72978F11A00BA99FE /* Home.swift */,
4D9D43542C596CED000062D3 /* SharedExtensions */,
4D065BDE2C093FF600EBB3AE /* ReusableElements */,
Expand Down Expand Up @@ -1073,7 +1083,6 @@
children = (
A9DFE8A82ABE551400428242 /* AccountButton.swift */,
A9720E422ABB68CC00872D23 /* AccountSetupHeader.swift */,
A9623C072C18D03F00189BA1 /* AccountSetupSheet.swift */,
A9FE7ACF2AA39BAB0077B045 /* AccountSheet.swift */,
4D8CE0FE2C7540C000560327 /* AdditionalAccountSections.swift */,
A96C56BA2C0DFFCE00D6A50B /* InvitationCodeModule.swift */,
Expand Down Expand Up @@ -1279,7 +1288,7 @@
2FE5DC4129EDD7EE004B9AB4 /* StorageKeys.swift in Sources */,
4D73A51B2C581C8F00CCEC46 /* TargetLabelSizeKey.swift in Sources */,
4D0F389E2C09779100DA12F7 /* ShowMoreButton.swift in Sources */,
4D081A1F2C6C1A3400E13BC8 /* OrganizationInformation.swift in Sources */,
4D081A1F2C6C1A3400E13BC8 /* Organization.swift in Sources */,
4DDFC7652BF350C2002B07A1 /* Education.swift in Sources */,
4DBE86DD2C7F9BBF0003390B /* MobilePlatform.swift in Sources */,
4D70CF6A2C65423D00EB4CC6 /* GraphSelection.swift in Sources */,
Expand All @@ -1305,6 +1314,7 @@
4D8CE0FC2C753A4700560327 /* NotificationManager.swift in Sources */,
4DC0F67A2C34AD620025AB13 /* VitalsList.swift in Sources */,
2FE5DC3829EDD7CA004B9AB4 /* InterestingModules.swift in Sources */,
9B1864882C9226E90042AC81 /* AccountDetails+Key.swift in Sources */,
4D8402B22C51D62400817495 /* MedicationsList.swift in Sources */,
4DC990612C7D3A13001E86C5 /* ClosedRange+InitFromSequence.swift in Sources */,
4D73A5112C58088E00CCEC46 /* PositionedCurrentLabel.swift in Sources */,
Expand All @@ -1313,14 +1323,14 @@
4DA20B642C2A0FF100715AA2 /* VitalsCard.swift in Sources */,
4DBDD3442BBFAD64001FB0CA /* InvitationCodeError.swift in Sources */,
4D8402B52C51D6D200817495 /* MedicationRecommendationSymbol.swift in Sources */,
9B1864982C9350D30042AC81 /* Account+Binding.swift in Sources */,
4D40A4AF2C5A9B4F003DC813 /* VideoPlayer.swift in Sources */,
4D84027E2C4EF82D00817495 /* AddMeasurementAsyncButton.swift in Sources */,
4D8402AE2C51C66D00817495 /* Medications.swift in Sources */,
4D8402E52C545A4B00817495 /* ScheduleSummary.swift in Sources */,
4DF3700D2C66E479004D737A /* PDFDocument+Transferable.swift in Sources */,
2FC975A82978F11A00BA99FE /* Home.swift in Sources */,
4D40A4C62C5AE486003DC813 /* VideoListSection.swift in Sources */,
A9623C082C18D03F00189BA1 /* AccountSetupSheet.swift in Sources */,
4D8CE0F62C752D1C00560327 /* VideoCollection.swift in Sources */,
4D40727E2C465554007C5621 /* HKSampleGraphError.swift in Sources */,
4D4072782C460014007C5621 /* TapDrag+GestureValue.swift in Sources */,
Expand All @@ -1334,6 +1344,7 @@
4D40729F2C488172007C5621 /* KnownVitalsSeries.swift in Sources */,
4D8CE0F52C752D1C00560327 /* Video.swift in Sources */,
4DF36FFD2C66A904004D737A /* QuestionnaireSheetView.swift in Sources */,
9B18648B2C9227040042AC81 /* AccountNotifications+Extras.swift in Sources */,
2FF350E42C4F3F0B0095F08F /* Firebase+References.swift in Sources */,
4DC0F6712C34818B0025AB13 /* HKSample+GetDoubleValues.swift in Sources */,
4D62BF392C6A978C0088C414 /* (null) in Sources */,
Expand All @@ -1357,7 +1368,6 @@
4D34B3ED2C404C61006F0D40 /* VitalsUnit.swift in Sources */,
4D40A4CA2C5AF34D003DC813 /* EducationalVideoCard.swift in Sources */,
4D05F26D2C54696100201581 /* DosageGaugeStyle.swift in Sources */,
4D081A262C6C2C6B00E13BC8 /* NotificationSettings.swift in Sources */,
4D73A5142C5816AF00CCEC46 /* View+ReadSize.swift in Sources */,
4D40A4D22C5B0AB2003DC813 /* VideoList.swift in Sources */,
4D4670CC2C79408C004DEAC4 /* VitalsGraph+GraphHeader.swift in Sources */,
Expand Down Expand Up @@ -1394,6 +1404,7 @@
A96C56BB2C0DFFCE00D6A50B /* InvitationCodeModule.swift in Sources */,
4D4072762C45FF5B007C5621 /* GestureValue.swift in Sources */,
4DA20B5A2C25FEDE00715AA2 /* Decimal+IntConversion.swift in Sources */,
9B9C21E02C89389900FE1430 /* ContentView.swift in Sources */,
4DF370082C66CAC9004D737A /* PDFViewer.swift in Sources */,
4D92B9F42C3C8DF900ABCED7 /* MeasurementListRow.swift in Sources */,
4D9D43742C59BDB2000062D3 /* (null) in Sources */,
Expand All @@ -1412,6 +1423,7 @@
4D8402702C4EBE7D00817495 /* AddMeasurementView.swift in Sources */,
4D2D1D602C2B859C00ABDC19 /* GraphPicker.swift in Sources */,
4D8402DE2C5417F400817495 /* MedicationDescription.swift in Sources */,
9B1864942C9276C40042AC81 /* AuthFlow.swift in Sources */,
4DBDD3462BBFAE2D001FB0CA /* InvitationCodeView.swift in Sources */,
4D40A4B62C5AA094003DC813 /* VideoView.swift in Sources */,
4DB624862C73F1BF00573807 /* NotificationSettingsView.swift in Sources */,
Expand Down Expand Up @@ -1980,8 +1992,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/SpeziAccount.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = "2.0.0-beta.7";
branch = "add-hidden-requirement";
kind = branch;
};
};
2FE5DC6529EDD894004B9AB4 /* XCRemoteSwiftPackageReference "SpeziContact" */ = {
Expand All @@ -2004,8 +2016,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/SpeziFirebase.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = "2.0.0-beta.3";
branch = "fetch-account-details";
kind = branch;
};
};
2FE5DC8229EDD934004B9AB4 /* XCRemoteSwiftPackageReference "SpeziQuestionnaire" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
{
"identity" : "fhirmodels",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/FHIRModels.git",
"location" : "https://github.com/apple/FHIRModels",
"state" : {
"revision" : "861afd5816a98d38f86220eab2f812d76cad84a0",
"version" : "0.5.0"
Expand Down Expand Up @@ -114,8 +114,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordBDHG/HealthKitOnFHIR.git",
"state" : {
"branch" : "fix/swiftlint-dependency",
"revision" : "4c4c4d7020016e01904e07763a39088e5a4e132c"
"revision" : "87a9257e6fa37407f3437e4a0bf21dd09a4ea7c5",
"version" : "0.2.11"
}
},
{
Expand Down Expand Up @@ -195,8 +195,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziAccount.git",
"state" : {
"revision" : "7e78ee9e7e4df2071a18ac0fc722671ac1dcfac4",
"version" : "2.0.0-beta.7"
"branch" : "add-hidden-requirement",
"revision" : "a3fe2bf688b06a8ef7e117e7e091c250b10e28f4"
}
},
{
Expand Down Expand Up @@ -231,8 +231,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziFirebase.git",
"state" : {
"revision" : "d0cb58fc43c99e632446b43c5cb56943f8339bf2",
"version" : "2.0.0-beta.3"
"branch" : "fetch-account-details",
"revision" : "42e15c9332f317388e80dca61dd10f9a0bf66e5c"
}
},
{
Expand Down Expand Up @@ -310,7 +310,7 @@
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
"version" : "1.5.0"
Expand Down Expand Up @@ -339,8 +339,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "4c4453b489cf76e6b3b0f300aba663eb78182fad",
"version" : "2.70.0"
"revision" : "9746cf80e29edfef2a39924a66731249223f42a3",
"version" : "2.72.0"
}
},
{
Expand Down
58 changes: 0 additions & 58 deletions ENGAGEHF/Account/AccountSetupSheet.swift

This file was deleted.

39 changes: 3 additions & 36 deletions ENGAGEHF/Account/AccountSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,17 @@
// SPDX-License-Identifier: MIT
//

import FirebaseFunctions
@_spi(TestingSupport) import SpeziAccount
import SpeziLicense
import SwiftUI


struct AccountSheet: View {
@Environment(\.dismiss) var dismiss

@Environment(Account.self) private var account
@Environment(\.accountRequired) var accountRequired

@State var isInSetup = false


var body: some View {
NavigationStack {
ZStack {
if account.signedIn && !isInSetup {
AccountOverview(close: .showCloseButton, deletion: .disabled) {
AdditionalAccountSections()
}
} else {
AccountSetup { _ in
dismiss() // we just signed in, dismiss the account setup sheet
} header: {
AccountSetupHeader()
}
.onAppear {
isInSetup = true
}
.toolbar {
if !accountRequired {
closeButton
}
}
}
}
}
}

var closeButton: some ToolbarContent {
ToolbarItem(placement: .cancellationAction) {
Button("CLOSE") {
dismiss()
AccountOverview(close: .showCloseButton, deletion: .disabled) {
AdditionalAccountSections()
}
}
}
Expand Down
Loading
Loading