diff --git a/Sources/allin/allin.xcodeproj/project.pbxproj b/Sources/allin/allin.xcodeproj/project.pbxproj index f526a57..30fc174 100644 --- a/Sources/allin/allin.xcodeproj/project.pbxproj +++ b/Sources/allin/allin.xcodeproj/project.pbxproj @@ -29,6 +29,7 @@ EC46D7DF2ABCE0A20030AC04 /* ParameterMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC46D7DE2ABCE0A20030AC04 /* ParameterMenuView.swift */; }; EC50BF962ABF4D3300197685 /* SplashScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC50BF952ABF4D3300197685 /* SplashScreen.swift */; }; EC50BF982ABF541B00197685 /* WelcomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC50BF972ABF541B00197685 /* WelcomeScreen.swift */; }; + EC55565D2AD6E5B900E5CA3F /* AuthService.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC55565C2AD6E5B900E5CA3F /* AuthService.swift */; }; EC8601F52AC37919004262C8 /* HomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC8601F42AC37919004262C8 /* HomeScreen.swift */; }; EC87FCD62ABBA24000363986 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC87FCD52ABBA24000363986 /* Extensions.swift */; }; EC87FCD92ABBA60900363986 /* Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC87FCD82ABBA60900363986 /* Colors.swift */; }; @@ -38,6 +39,8 @@ ECA7010B2AC4003400532444 /* RankingRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECA7010A2AC4003400532444 /* RankingRowView.swift */; }; ECA7010D2AC4948600532444 /* FriendsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECA7010C2AC4948600532444 /* FriendsScreen.swift */; }; ECA7010F2AC4949D00532444 /* FriendView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECA7010E2AC4949D00532444 /* FriendView.swift */; }; + ECCD6DD92AD7228B00F947C4 /* Singleton.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECCD6DD82AD7228B00F947C4 /* Singleton.swift */; }; + ECCD6DDB2AD7233F00F947C4 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECCD6DDA2AD7233F00F947C4 /* User.swift */; }; ECDF624A2AC1CAFD00BA8213 /* RegisterScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */; }; ECFC54442AC0C39E00195760 /* LoginScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFC54432AC0C39E00195760 /* LoginScreen.swift */; }; /* End PBXBuildFile section */ @@ -86,6 +89,7 @@ EC46D7DE2ABCE0A20030AC04 /* ParameterMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ParameterMenuView.swift; path = allin/Views/ParameterMenuView.swift; sourceTree = SOURCE_ROOT; }; EC50BF952ABF4D3300197685 /* SplashScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SplashScreen.swift; path = allin/Screens/SplashScreen.swift; sourceTree = SOURCE_ROOT; }; EC50BF972ABF541B00197685 /* WelcomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WelcomeScreen.swift; path = allin/Screens/WelcomeScreen.swift; sourceTree = SOURCE_ROOT; }; + EC55565C2AD6E5B900E5CA3F /* AuthService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AuthService.swift; path = allin/Services/AuthService.swift; sourceTree = SOURCE_ROOT; }; EC8601F42AC37919004262C8 /* HomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HomeScreen.swift; path = allin/Screens/HomeScreen.swift; sourceTree = SOURCE_ROOT; }; EC87FCD52ABBA24000363986 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = allin/Extensions/Extensions.swift; sourceTree = SOURCE_ROOT; }; EC87FCD82ABBA60900363986 /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Colors.swift; path = allin/Ressources/Colors.swift; sourceTree = SOURCE_ROOT; }; @@ -95,6 +99,8 @@ ECA7010A2AC4003400532444 /* RankingRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RankingRowView.swift; path = allin/Views/RankingRowView.swift; sourceTree = SOURCE_ROOT; }; ECA7010C2AC4948600532444 /* FriendsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = FriendsScreen.swift; path = allin/Screens/FriendsScreen.swift; sourceTree = SOURCE_ROOT; }; ECA7010E2AC4949D00532444 /* FriendView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = FriendView.swift; path = allin/Views/FriendView.swift; sourceTree = SOURCE_ROOT; }; + ECCD6DD82AD7228B00F947C4 /* Singleton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Singleton.swift; path = allin/Models/Singleton.swift; sourceTree = SOURCE_ROOT; }; + ECCD6DDA2AD7233F00F947C4 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = User.swift; path = allin/Models/User.swift; sourceTree = SOURCE_ROOT; }; ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RegisterScreen.swift; path = allin/Screens/RegisterScreen.swift; sourceTree = SOURCE_ROOT; }; ECFC54432AC0C39E00195760 /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LoginScreen.swift; path = allin/Screens/LoginScreen.swift; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ @@ -168,6 +174,8 @@ D98C4D622AB9D017007A6B4D /* AllIn */ = { isa = PBXGroup; children = ( + ECCD6DD72AD7227500F947C4 /* Models */, + EC55565B2AD6E59C00E5CA3F /* Services */, EC9A45AE2ABDF47A00125D41 /* Screens */, EC0EA7AD2ABDAAAC006BA4A0 /* Fonts */, EC87FCD72ABBA5F200363986 /* Ressources */, @@ -214,6 +222,14 @@ path = Fonts; sourceTree = ""; }; + EC55565B2AD6E59C00E5CA3F /* Services */ = { + isa = PBXGroup; + children = ( + EC55565C2AD6E5B900E5CA3F /* AuthService.swift */, + ); + path = Services; + sourceTree = ""; + }; EC87FCD72ABBA5F200363986 /* Ressources */ = { isa = PBXGroup; children = ( @@ -239,6 +255,15 @@ path = Screens; sourceTree = ""; }; + ECCD6DD72AD7227500F947C4 /* Models */ = { + isa = PBXGroup; + children = ( + ECCD6DD82AD7228B00F947C4 /* Singleton.swift */, + ECCD6DDA2AD7233F00F947C4 /* User.swift */, + ); + path = Models; + sourceTree = ""; + }; ECF816C72ABB51E300DE30A4 /* Extensions */ = { isa = PBXGroup; children = ( @@ -381,6 +406,7 @@ EC31955E2ACD3B8E00D0A4DC /* ConfidentialityView.swift in Sources */, ECA701092AC3FE3300532444 /* RankingScreen.swift in Sources */, ECFC54442AC0C39E00195760 /* LoginScreen.swift in Sources */, + ECCD6DDB2AD7233F00F947C4 /* User.swift in Sources */, EC87FCD62ABBA24000363986 /* Extensions.swift in Sources */, EC46D7DD2ABCCC270030AC04 /* MenuView.swift in Sources */, EC2C1EEB2AC08BE80091D57C /* BetCard.swift in Sources */, @@ -388,7 +414,9 @@ EC87FCD92ABBA60900363986 /* Colors.swift in Sources */, EC3737E82AC5A53B00E6BDB5 /* AllcoinsCapsule.swift in Sources */, EC3737EA2AC5A58B00E6BDB5 /* RecapBetCard.swift in Sources */, + EC55565D2AD6E5B900E5CA3F /* AuthService.swift in Sources */, D98C4D662AB9D017007A6B4D /* ContentView.swift in Sources */, + ECCD6DD92AD7228B00F947C4 /* Singleton.swift in Sources */, D92EC57C2ABADA2800CCD30E /* CoinCounterView.swift in Sources */, EC3737E42AC2F5FB00E6BDB5 /* ChoiceCapsule.swift in Sources */, EC3737E62AC41DB000E6BDB5 /* WinModal.swift in Sources */, diff --git a/Sources/allin/allin/ContentView.swift b/Sources/allin/allin/ContentView.swift index 30cfc89..f5b2673 100644 --- a/Sources/allin/allin/ContentView.swift +++ b/Sources/allin/allin/ContentView.swift @@ -11,7 +11,7 @@ struct ContentView: View { var body: some View { NavigationView { - Home(page: "CreationBet") + Welcome() } } } diff --git a/Sources/allin/allin/Models/Singleton.swift b/Sources/allin/allin/Models/Singleton.swift new file mode 100644 index 0000000..30b7674 --- /dev/null +++ b/Sources/allin/allin/Models/Singleton.swift @@ -0,0 +1,19 @@ +// +// Singleton.swift +// AllIn +// +// Created by étudiant on 11/10/2023. +// + +import Foundation + +class Singleton { + + static let singleton = Singleton() + + var user: User? + + var auth: AuthService = AuthService() + + private init() { } +} diff --git a/Sources/allin/allin/Models/User.swift b/Sources/allin/allin/Models/User.swift new file mode 100644 index 0000000..d848175 --- /dev/null +++ b/Sources/allin/allin/Models/User.swift @@ -0,0 +1,21 @@ +// +// User.swift +// AllIn +// +// Created by étudiant on 11/10/2023. +// + +import Foundation + +class User { + + public var Username: String + public var Email: String + public var NbCoins: Int + + public init(Username: String, andEmail Email: String, NbCoins: Int) { + self.Username = Username + self.Email = Email + self.NbCoins = NbCoins + } +} diff --git a/Sources/allin/allin/Screens/CreationBetScreen.swift b/Sources/allin/allin/Screens/CreationBetScreen.swift index f2f6b22..b7b85df 100644 --- a/Sources/allin/allin/Screens/CreationBetScreen.swift +++ b/Sources/allin/allin/Screens/CreationBetScreen.swift @@ -255,6 +255,11 @@ struct CreationBet: View { ) .frame(width: 250, height: 38) .foregroundColor(.black) + .onChange(of: response) { newValue in + if newValue.count > 20 { + response = String(newValue.prefix(20)) + } + } Button(action: { diff --git a/Sources/allin/allin/Screens/LoginScreen.swift b/Sources/allin/allin/Screens/LoginScreen.swift index de07e4d..0e5dcf8 100644 --- a/Sources/allin/allin/Screens/LoginScreen.swift +++ b/Sources/allin/allin/Screens/LoginScreen.swift @@ -12,6 +12,10 @@ struct Login: View { @State private var isPasswordVisible = true @State private var username: String = "" @State private var password: String = "" + @State private var showErrorAlert = false + @State private var errorAlertMessage = "" + @State private var isLoginSuccessful = false + var body: some View { GeometryReader { geometry in VStack(spacing: 15) { @@ -33,6 +37,7 @@ struct Login: View { RoundedRectangle(cornerRadius: 9, style: .continuous) .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) ) + .autocapitalization(.none) .padding(.bottom, 8) Group { @@ -69,8 +74,9 @@ struct Login: View { .padding(.leading, 150) .betTextStyle(weight: .medium, color: AllinColor.StartTextColor, size: 14) - NavigationLink(destination: Home(page: "Bet").navigationBarBackButtonHidden(true)) - { + Button(action: { + login(email: username, password: password) + }) { Text("Se connecter") .betTextStyle(weight: .bold, color: .white, size: 17) .frame(width: 300, height: 60) @@ -79,6 +85,10 @@ struct Login: View { startPoint: .leading, endPoint: .trailing)) .cornerRadius(13) } + .background( + NavigationLink("", destination: Home(page: "Bet").navigationBarBackButtonHidden(true), isActive: $isLoginSuccessful) + .opacity(0) + ) Spacer() HStack(spacing: 0) { @@ -95,7 +105,25 @@ struct Login: View { .frame(width: geometry.size.width, height: geometry.size.height) .background(AllinColor.StartBackground) } + .alert(isPresented: $showErrorAlert) { + Alert(title: Text("Erreur de connexion"), message: Text(errorAlertMessage), dismissButton: .default(Text("OK"))) + } } + func login(email: String, password: String) { + let api = AuthService() + + api.login(email: email, password: password) { statusCode in + DispatchQueue.main.async { + if statusCode == 200 { + isLoginSuccessful = true + } else { + errorAlertMessage = "La connexion a échoué. Veuillez réessayer." + showErrorAlert = true + } + } + } + } } + diff --git a/Sources/allin/allin/Screens/RegisterScreen.swift b/Sources/allin/allin/Screens/RegisterScreen.swift index ef88316..5628870 100644 --- a/Sources/allin/allin/Screens/RegisterScreen.swift +++ b/Sources/allin/allin/Screens/RegisterScreen.swift @@ -10,18 +10,26 @@ import SwiftUI struct Register: View { @State private var isPasswordVisible = true - @State private var pseudo: String = "" @State private var username: String = "" + @State private var email: String = "" @State private var password: String = "" @State private var passwordConfirm: String = "" + @State private var isRegisterSuccessful = false + @State private var errorPassword = false + @State private var errorMail = false + @State private var errorUsername = false + @State private var errorMailMessage: String = "" + @State private var errorUsernameMessage: String = "" + @State private var errorPasswordMessage: String = "" + var body: some View { GeometryReader { geometry in ScrollView(showsIndicators: false) { VStack(spacing: 15) { Spacer() VStack { - if (pseudo != "") { - Text("Bonjour "+pseudo+",") + if (username != "") { + Text("Bonjour "+username+",") .betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40) .padding([.trailing, .leading], 30) } else { @@ -40,88 +48,134 @@ struct Register: View { .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 20) .padding(.bottom, 60) - TextField("", text: $pseudo, prompt: Text("Pseudo").foregroundColor(.gray)) + VStack { + if errorUsername { + Text(errorUsernameMessage) + .font(.system(size: 10)) + .foregroundColor(.red) + .fontWeight(.bold) + } + TextField("", text: $username, prompt: Text("Pseudo").foregroundColor(.gray)) + .padding() + .background(Color.white.cornerRadius(9)) + .frame(width: 300) + .foregroundColor(.black) + .overlay( + RoundedRectangle(cornerRadius: 9, style: .continuous) + .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + ) + .padding(.bottom, 8) + .onChange(of: username) { newValue in + if newValue.count > 25 { + username = String(newValue.prefix(25)) + } + } + } + + VStack { + if errorMail { + Text(errorMailMessage) + .font(.system(size: 10)) + .foregroundColor(.red) + .fontWeight(.bold) + } + TextField("", text: $email, prompt: Text("Email").foregroundColor(.gray)) + .padding() + .background(Color.white.cornerRadius(9)) + .frame(width: 300) + .foregroundColor(.black) + .overlay( + RoundedRectangle(cornerRadius: 9, style: .continuous) + .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + ) + .padding(.bottom, 8) + .onChange(of: email) { newValue in + if newValue.count > 50 { + email = String(newValue.prefix(50)) + } + } + } + + VStack { + if errorPassword { + Text(errorPasswordMessage) + .font(.system(size: 10)) + .foregroundColor(.red) + .fontWeight(.bold) + } + Group { + if isPasswordVisible { + SecureField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) + } else { + TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) + .autocapitalization(.none) + } + } .padding() .background(Color.white.cornerRadius(9)) .frame(width: 300) - .foregroundColor(.black) .overlay( RoundedRectangle(cornerRadius: 9, style: .continuous) .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) ) + .foregroundColor(.black) .padding(.bottom, 8) + .overlay( + HStack { + Spacer() + Button(action: { + isPasswordVisible.toggle() + }) { + Image(systemName: isPasswordVisible ? "eye.slash" : "eye") + .foregroundColor(.gray) + } + .padding(.bottom, 8) + .padding(.trailing, 8) + } + ) + } - TextField("", text: $username, prompt: Text("Email").foregroundColor(.gray)) + VStack { + if errorPassword { + Text(errorPasswordMessage) + .font(.system(size: 10)) + .foregroundColor(.red) + .fontWeight(.bold) + } + + Group { + if isPasswordVisible { + SecureField("", text: $passwordConfirm, prompt: Text("Confirmation du Mot de passe").foregroundColor(.gray)) + } else { + TextField("", text: $passwordConfirm, prompt: Text("Confirmation du Mot de passe").foregroundColor(.gray)) + .autocapitalization(.none) + } + } .padding() .background(Color.white.cornerRadius(9)) .frame(width: 300) - .foregroundColor(.black) .overlay( RoundedRectangle(cornerRadius: 9, style: .continuous) .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) ) - .padding(.bottom, 8) - - Group { - if isPasswordVisible { - SecureField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) - } else { - TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) - } - } - .padding() - .background(Color.white.cornerRadius(9)) - .frame(width: 300) - .overlay( - RoundedRectangle(cornerRadius: 9, style: .continuous) - .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) - ) - .foregroundColor(.black) - .padding(.bottom, 8) - .overlay( - HStack { - Spacer() - Button(action: { - isPasswordVisible.toggle() - }) { - Image(systemName: isPasswordVisible ? "eye.slash" : "eye") - .foregroundColor(.gray) + .overlay( + HStack { + Spacer() + Button(action: { + isPasswordVisible.toggle() + }) { + Image(systemName: isPasswordVisible ? "eye.slash" : "eye") + .foregroundColor(.gray) + } + .padding(.trailing, 8) } - .padding(.bottom, 8) - .padding(.trailing, 8) - } - ) - - Group { - if isPasswordVisible { - SecureField("", text: $passwordConfirm, prompt: Text("Confirmation du Mot de passe").foregroundColor(.gray)) - } else { - TextField("", text: $passwordConfirm, prompt: Text("Confirmation du Mot de passe").foregroundColor(.gray)) - } + ) + .foregroundColor(.black) + .padding(.bottom, 50) } - .padding() - .background(Color.white.cornerRadius(9)) - .frame(width: 300) - .overlay( - RoundedRectangle(cornerRadius: 9, style: .continuous) - .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) - ) - .overlay( - HStack { - Spacer() - Button(action: { - isPasswordVisible.toggle() - }) { - Image(systemName: isPasswordVisible ? "eye.slash" : "eye") - .foregroundColor(.gray) - } - .padding(.trailing, 8) - } - ) - .foregroundColor(.black) - .padding(.bottom, 50) - - Button(action: {}) { + Button(action: { + register(email: email, username: username, password: password, confirmPassword: passwordConfirm) + }) { Text("S'inscrire") .betTextStyle(weight: .bold, color: .white, size: 17) } @@ -129,6 +183,10 @@ struct Register: View { .background(LinearGradient(gradient: Gradient(colors:[AllinColor.TopBarColorPink,AllinColor.TopBarColorPurple,AllinColor.TopBarColorBlue]), startPoint: .leading, endPoint: .trailing)) + .background( + NavigationLink("", destination: Home(page: "Bet").navigationBarBackButtonHidden(true), isActive: $isRegisterSuccessful) + .opacity(0) + ) .cornerRadius(13) Spacer() @@ -151,4 +209,62 @@ struct Register: View { } } + func register(email: String, username: String, password: String, confirmPassword: String) { + cleanError() + if password != confirmPassword { + errorPassword = true + errorPasswordMessage = "Les mots de passes doivent être identiques." + return + } + if username.isEmpty { + errorUsername = true + errorUsernameMessage = "Le pseudo ne peut pas être vide." + return + } + + if email.isEmpty { + errorMail = true + errorMailMessage = "Le mail ne peut pas être vide." + return + } + + if password.isEmpty || confirmPassword.isEmpty { + errorPassword = true + errorPasswordMessage = "Veuillez renseigner le mot de passe sur les deux champs." + return + } + + if isValidEmail(email: email) { + errorMail = true + errorMailMessage = "L'adresse e-mail n'est pas valide." + return + } + + let api = AuthService() + api.register(email: email, password: password, username: username) { statusCode in + DispatchQueue.main.async { + if statusCode == 201 { + isRegisterSuccessful = true + } else { + + } + } + } + } + + func isValidEmail(email: String) -> Bool + { + if(email.range(of:"^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$", options: .regularExpression) != nil) { + return false + } else { + return true + } + } + + func cleanError() { + errorPassword = false + errorMail = false + errorUsername = false + } + } diff --git a/Sources/allin/allin/Services/AuthService.swift b/Sources/allin/allin/Services/AuthService.swift new file mode 100644 index 0000000..d02691d --- /dev/null +++ b/Sources/allin/allin/Services/AuthService.swift @@ -0,0 +1,59 @@ +// +// AuthService.swift +// AllIn +// +// Created by étudiant on 11/10/2023. +// + +import Foundation + +class AuthService { + + let baseURL : String = "https://codefirst.iut.uca.fr/containers/AllDev-api/" + + public func login(email : String, password : String, completion : @escaping (Int)-> ()){ + let url = URL(string: baseURL+"users/login")! + var request = URLRequest(url: url) + request.httpMethod = "POST" + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + + let json = [ + "username":email, + "password":password, + ] + + if let jsonData = try? JSONSerialization.data(withJSONObject: json, options: []){ + URLSession.shared.uploadTask(with: request, from: jsonData) { data, response, error in + print ("ALLIN : Process LOGIN") + if let httpResponse = response as? HTTPURLResponse { + completion(httpResponse.statusCode) + } + }.resume() + } + } + + + public func register(email : String, password : String, username : String, completion : @escaping (Int)-> ()){ + let url = URL(string: baseURL+"/users/register")! + var request = URLRequest(url: url) + request.httpMethod = "POST" + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + + let json = [ + "email":email, + "username":username, + "password":password, + "nbCoins": "0" + ] + + if let jsonData = try? JSONSerialization.data(withJSONObject: json, options: []){ + URLSession.shared.uploadTask(with: request, from: jsonData) { data, response, error in + print ("ALLIN : Process REGISTER") + if let httpResponse = response as? HTTPURLResponse { + completion(httpResponse.statusCode) + } + }.resume() + } + } + +} diff --git a/Sources/allin/allin/allinApp.swift b/Sources/allin/allin/allinApp.swift index 0b5242b..c09bd14 100644 --- a/Sources/allin/allin/allinApp.swift +++ b/Sources/allin/allin/allinApp.swift @@ -9,9 +9,11 @@ import SwiftUI @main struct AllInApp: App { + //@StateObject var auth = AuthService() var body: some Scene { WindowGroup { ContentView() + // .environmentObject(auth) } } }