Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add login flow & session management#10

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanndickson merged 4 commits intomainfromethan/login-flow
Dec 12, 2024

Conversation

ethanndickson
Copy link
Member

@ethanndicksonethanndickson commentedDec 11, 2024
edited
Loading

Closes#3.
Relates to#4.

  • Adds a stockAbout popup.
  • Adds aSecureSession that writes the session token to the keychain, and the server URL toUserDefaults.
  • Adds an initialClient for the Swiftcoderd SDK. Currently only supports theusers endpoint for validating a session token.
Screen.Recording.2024-12-11.at.5.40.42.pm.mov

The 'generate a token' hyperlink takes the user to/cli-auth.

mopuppet reacted with rocket emoji
@ethanndicksonGraphite App
Copy link
MemberAuthor

ethanndickson commentedDec 11, 2024
edited
Loading

This stack of pull requests is managed byGraphite. Learn more aboutstacking.

@ethanndicksonethanndickson marked this pull request as ready for reviewDecember 11, 2024 06:47
Copy link
Member

@deansheatherdeansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM, I like the tests

@ethanndickson
Copy link
MemberAuthor

ethanndickson commentedDec 11, 2024
edited
Loading

imageimage

I didn't like that the form wasn't centered in the window, so it looks like this now. The macOS screenshot tool tells me the padding at the top and bottom is the same (50px).

I don't love the progress view (spinner), so I might get rid of it. I think the buttons disabling/dimming is enough feedback.

}

enum ClientError: Error {
case unexpectedStatusCode
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
case unexpectedStatusCode
case unexpectedStatusCode(Int)

This lets you store the status code

func user(_ ident: String) async throws -> User {
let resp = await request("/api/v2/users/\(ident)", method: .get)
guard let response = resp.response, response.statusCode == 200 else {
throw ClientError.unexpectedStatusCode
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

fine for now, but we should be parsing the generic error responses for debugging/troubleshooting

e.g.https://github.com/coder/coder/blob/b39becba66f1c6ad9c8d73694b0d8779cf7467a2/codersdk/client.go#L495

}
}
}.onReceive(inspection.notice) { self.inspection.visit(self, $0) } // ViewInspector
Copy link
MemberAuthor

@ethanndicksonethanndicksonDec 12, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I absolutely hate that you need to modify your UI code to get the tests to work, but you do. Ifnalexn/ViewInspector#231 is ever resolved you'd be able to just wrap the view with the inspector at test-time instead.

@ethanndicksonethanndickson merged commitc070ac7 intomainDec 12, 2024
1 check passed
@ethanndicksonethanndickson deleted the ethan/login-flow branchJanuary 23, 2025 02:49
@ethanndicksonethanndickson self-assigned thisMay 23, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@spikecurtisspikecurtisspikecurtis approved these changes

@deansheatherdeansheatherdeansheather approved these changes

Assignees

@ethanndicksonethanndickson

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Build the Coder login UX flow
3 participants
@ethanndickson@spikecurtis@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp