generated from StanfordSpezi/SpeziTemplateApplication
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable Invitation Code Validation using Firebase Cloud Functions (#5)
# Enable Invitation Code Validation using Firebase Cloud Functions ## ⚙️ Release Notes - Enable Invitation Code Validation using Firebase Cloud Functions ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
- Loading branch information
1 parent
f078a9b
commit 4f5e88d
Showing
36 changed files
with
7,141 additions
and
923 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
StudyApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
StudyApplication/Firebase/FirebaseAccountConfiguration.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// This source file is part of the StudyApplication based on the Stanford Spezi Template Application project | ||
// | ||
// SPDX-FileCopyrightText: 2023 Stanford University | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
|
||
import Spezi | ||
import class FirebaseAuth.Auth | ||
import SpeziFirebaseConfiguration | ||
|
||
|
||
/// Module to configure firebase auth for anonumous authentication. | ||
final class FirebaseAccountConfiguration: Module { | ||
@Dependency private var configureFirebaseApp: ConfigureFirebaseApp | ||
|
||
private let emulatorSettings: (host: String, port: Int)? | ||
|
||
|
||
/// - Parameters: | ||
/// - emulatorSettings: The emulator settings. The default value is `nil`, connecting the FirebaseAccount module to the Firebase Auth cloud instance. | ||
init( | ||
emulatorSettings: (host: String, port: Int)? = nil | ||
) { | ||
self.emulatorSettings = emulatorSettings | ||
} | ||
|
||
|
||
func configure() { | ||
if let emulatorSettings { | ||
Auth.auth().useEmulator(withHost: emulatorSettings.host, port: emulatorSettings.port) | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
StudyApplication/Firebase/FirebaseFunctionsConfiguration.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// This source file is part of the StudyApplication based on the Stanford Spezi Template Application project | ||
// | ||
// SPDX-FileCopyrightText: 2023 Stanford University | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
|
||
import FirebaseFunctions | ||
import Spezi | ||
import SpeziFirebaseConfiguration | ||
|
||
|
||
/// Module to configure Firebase Functions | ||
final class FirebaseFunctionsConfiguration: Module { | ||
@Dependency private var configureFirebaseApp: ConfigureFirebaseApp | ||
|
||
private let emulatorSettings: (host: String, port: Int)? | ||
|
||
|
||
/// - Parameters: | ||
/// - emulatorSettings: The emulator settings. The default value is `nil`, connecting the FirebaseFunctions module to the Firebase Functions cloud instance. | ||
init( | ||
emulatorSettings: (host: String, port: Int)? = nil | ||
) { | ||
self.emulatorSettings = emulatorSettings | ||
} | ||
|
||
|
||
func configure() { | ||
if let emulatorSettings { | ||
Functions.functions().useEmulator(withHost: emulatorSettings.host, port: emulatorSettings.port) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.