Skip to content
This repository was archived by the owner on Mar 22, 2026. It is now read-only.

Commit dcb7b35

Browse files
fix login bug
1 parent c35a570 commit dcb7b35

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

MarkStream.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
6A8BC28A2C33AF3500200875 /* ObsidianRequester.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A8BC2892C33AF3500200875 /* ObsidianRequester.swift */; };
1919
6A8BC2912C3651B000200875 /* ObsidianRequester.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A8BC2892C33AF3500200875 /* ObsidianRequester.swift */; };
2020
6A8BC2922C3651B300200875 /* KeychainManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A8BC2872C33A7FE00200875 /* KeychainManager.swift */; };
21-
6A8BC2992C365AF100200875 /* TokenGranterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AF76F4A2C311468000F58B8 /* TokenGranterTests.swift */; };
21+
6AB544CF2C37937200189E1F /* TokenGranterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AF76F4A2C311468000F58B8 /* TokenGranterTests.swift */; };
2222
6ADA4F302C310C540057C65D /* MarkStreamApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ADA4F2F2C310C540057C65D /* MarkStreamApp.swift */; };
2323
6ADA4F322C310C540057C65D /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ADA4F312C310C540057C65D /* Persistence.swift */; };
2424
6ADA4F352C310C540057C65D /* MarkStream.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 6ADA4F332C310C540057C65D /* MarkStream.xcdatamodeld */; };
@@ -528,7 +528,7 @@
528528
isa = PBXSourcesBuildPhase;
529529
buildActionMask = 2147483647;
530530
files = (
531-
6A8BC2992C365AF100200875 /* TokenGranterTests.swift in Sources */,
531+
6AB544CF2C37937200189E1F /* TokenGranterTests.swift in Sources */,
532532
6ADA4F472C310C560057C65D /* MarkStreamTests.swift in Sources */,
533533
6ADA4F622C310E5A0057C65D /* TokenGranter.swift in Sources */,
534534
6A8BC2912C3651B000200875 /* ObsidianRequester.swift in Sources */,

MarkStream/MainEntryView/LoginView.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct LoginView: View {
1818

1919
func validate_user() async -> Bool {
2020
let setCorrectly = TokenGranter.shared.set_username_and_password(username: self.username, password: self.password);
21-
21+
2222
if(setCorrectly){
2323
return await TokenGranter.shared.grant_access_token();
2424
}
@@ -62,13 +62,13 @@ struct LoginView: View {
6262

6363
Button(action: {
6464
// Implement your login logic here
65-
print("Login button tapped")
6665
self.isAuthenticating = true // Disable inputs and button
6766

6867

6968
Task {
7069
let validated: Bool = await validate_user()
7170
self.isAuthenticated = validated;
71+
self.showError = false;
7272

7373

7474
if(validated){
@@ -94,7 +94,6 @@ struct LoginView: View {
9494

9595
}
9696
.padding()
97-
9897
}
9998
}
10099

MarkStream/MainEntryView/MarkdownViews/MarkdownFileView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ struct MarkdownFileView: View {
2020
MarkdownFileView(fileName: "Some File Here")
2121
.preferredColorScheme(.dark)
2222
}
23+

MarkStream/ServerRequester/TokenGranter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class TokenGranter {
6161

6262

6363
public func set_username_and_password(username: String, password: String) -> Bool {
64-
if(self.username().isEmpty || self.password().isEmpty){
64+
if(username.isEmpty || password.isEmpty){
6565
return false;
6666
}
6767

@@ -124,7 +124,7 @@ class TokenGranter {
124124
}
125125
}
126126
}
127-
//
127+
128128
// return await withCheckedContinuation { continuation in
129129
// AF.request(
130130
// grantTokenUrl,

MarkStreamTests/TokenGranterTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ class TokenGranterTests: XCTestCase {
1717
override func setUp() {
1818
super.setUp()
1919

20-
// Read local.config
21-
20+
21+
2222
self.username = ProcessInfo.processInfo.environment["APP_USERNAME"] ?? "";
2323
self.password = ProcessInfo.processInfo.environment["APP_PASSWORD"] ?? "";
2424

25-
// TURN ON FOR LOCLA TESTING, ENABLE loca.confog targets for markstream
25+
// // TURN ON FOR LOCAL TESTING, ENABLE loca.confog targets for markstream
2626
// if(self.username.isEmpty){
2727
// let configPath = Bundle.main.path(forResource: "local", ofType: "config") //
2828
//

0 commit comments

Comments
 (0)