My SwiftUI Project's user creation requests look unauthenticated, even if i unenforce appcheck cnnt
1 Reply
Hi everyone, i cant create user on my swiftUI firebase app. here is my login-signup page code;
import SwiftUI import Firebase struct ContentView: View { @State private var email: String = "" @State private var username: String = "" @State private var password: String = "" @State private var showAlert: Bool = false @State private var signUpAlert: Bool = false @State private var signInAlert: Bool = false
var body: some View {
NavigationStack { VStack(alignment: .center, spacing: 20) { Text("Snapchat Clone") .font(.largeTitle)
TextField("E-mail", text: $email) .textFieldStyle(RoundedBorderTextFieldStyle())
TextField("Username", text: $username) .textFieldStyle(RoundedBorderTextFieldStyle())
TextField("Password", text: $password) .textFieldStyle(RoundedBorderTextFieldStyle())
HStack(spacing: 20) { Button("Sign Up") {
if email.isEmpty username.isEmpty password.isEmpty { signUpAlert = true } else { Auth.auth().createUser(withEmail: email, password: password) } } .alert(isPresented: $signUpAlert) { Alert( title: Text("Uyarı"), message: Text("Lütfen Kaydolmak İçin tüm alanları doldurun"), dismissButton: .default(Text("Tamam")) { signUpAlert = false } ) } } .padding() .background(Color.blue) .foregroundColor(.white) .cornerRadius(10)
Button("Sign In") { if email.isEmpty username.isEmpty password.isEmpty { signInAlert = true } else { print("selam")
} } .alert(isPresented: $signInAlert) { Alert(title: Text("Uyarı"), message: Text("Lütfen Giriş Yapmak İçin tüm alanları doldurun"), dismissButton: .default(Text("Tamam")) { signUpAlert = false } ) }
.padding() .background(Color.green) .foregroundColor(.white) .cornerRadius(10) } } .padding() } } #Preview { ContentView() }
import SwiftUI import Firebase struct ContentView: View { @State private var email: String = "" @State private var username: String = "" @State private var password: String = "" @State private var showAlert: Bool = false @State private var signUpAlert: Bool = false @State private var signInAlert: Bool = false
var body: some View {
NavigationStack { VStack(alignment: .center, spacing: 20) { Text("Snapchat Clone") .font(.largeTitle)
TextField("E-mail", text: $email) .textFieldStyle(RoundedBorderTextFieldStyle())
TextField("Username", text: $username) .textFieldStyle(RoundedBorderTextFieldStyle())
TextField("Password", text: $password) .textFieldStyle(RoundedBorderTextFieldStyle())
HStack(spacing: 20) { Button("Sign Up") {
if email.isEmpty username.isEmpty password.isEmpty { signUpAlert = true } else { Auth.auth().createUser(withEmail: email, password: password) } } .alert(isPresented: $signUpAlert) { Alert( title: Text("Uyarı"), message: Text("Lütfen Kaydolmak İçin tüm alanları doldurun"), dismissButton: .default(Text("Tamam")) { signUpAlert = false } ) } } .padding() .background(Color.blue) .foregroundColor(.white) .cornerRadius(10)
Button("Sign In") { if email.isEmpty username.isEmpty password.isEmpty { signInAlert = true } else { print("selam")
} } .alert(isPresented: $signInAlert) { Alert(title: Text("Uyarı"), message: Text("Lütfen Giriş Yapmak İçin tüm alanları doldurun"), dismissButton: .default(Text("Tamam")) { signUpAlert = false } ) }
.padding() .background(Color.green) .foregroundColor(.white) .cornerRadius(10) } } .padding() } } #Preview { ContentView() }