Skip to content

[#191] 최초 로그인 시 자동으로 로그아웃 되는 현상을 해결한다#192

Merged
opficdev merged 2 commits intodevelopfrom
fix/#191-auto-logout
Mar 5, 2026
Merged

[#191] 최초 로그인 시 자동으로 로그아웃 되는 현상을 해결한다#192
opficdev merged 2 commits intodevelopfrom
fix/#191-auto-logout

Conversation

@opficdev
Copy link
Copy Markdown
Owner

@opficdev opficdev commented Mar 5, 2026

@opficdev opficdev self-assigned this Mar 5, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 풀 리퀘스트는 UserDefaults에 저장된 'isFirstLaunch' 플래그가 removeAll() 메서드 호출 시 초기화되어 발생하는 자동 로그아웃 문제를 해결합니다. 이제 'isFirstLaunch' 상태가 올바르게 유지되어 사용자가 한 번 로그인하면 세션이 지속됩니다.

Highlights

  • UserDefaults 데이터 보존: UserDefaultsStore의 removeAll() 메서드에서 'isFirstLaunch' 키의 값을 삭제하지 않고 유지하도록 수정되었습니다. 이로 인해 사용자가 최초 로그인 후 자동으로 로그아웃되는 문제를 방지합니다.
Changelog
  • DevLog/Storage/Persistence/UserDefaultsStore.swift
    • removeAll() 메서드에서 'isFirstLaunch' 값을 보존하도록 수정되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 사용자 데이터 삭제 시 isFirstLaunch 플래그를 보존하여 사용자가 의도치 않게 로그아웃되는 문제를 해결합니다. 접근 방식은 올바르다고 생각합니다. 제안된 변경 사항에 대해, 하드코딩된 키 문자열을 상수로 대체하고, 보존되는 값이 Bool 타입임을 보장하여 타입 안정성을 높이는 두 가지 개선 사항을 제안했습니다. 이를 통해 코드의 유지보수성과 안정성을 향상시킬 수 있습니다.


func removeAll() {
guard let bundleIdentifier = Bundle.main.bundleIdentifier else { return }
let firstLaunch = userDefaults.object(forKey: "isFirstLaunch")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

하드코딩된 문자열 "isFirstLaunch"를 사용하는 것보다, 재사용성과 유지보수성을 높이기 위해 이 키를 상수로 정의하는 것이 좋습니다. 예를 들어, private enum Keys { static let isFirstLaunch = "isFirstLaunch" } 와 같이 클래스 내에 정의하고 Keys.isFirstLaunch로 참조할 수 있습니다.

Comment on lines +45 to +47
if let firstLaunch {
userDefaults.set(firstLaunch, forKey: "isFirstLaunch")
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

현재 firstLaunch 객체의 타입을 확인하지 않고 다시 저장하고 있습니다. FetchFirstLaunchUseCase 등을 고려할 때 이 값은 Bool 타입이어야 할 것으로 보입니다. 타입 안정성을 높이기 위해 Bool 타입으로 캐스팅하여 저장하는 것이 안전합니다.

Suggested change
if let firstLaunch {
userDefaults.set(firstLaunch, forKey: "isFirstLaunch")
}
if let isFirstLaunch = firstLaunch as? Bool {
userDefaults.set(isFirstLaunch, forKey: "isFirstLaunch")
}

@opficdev opficdev changed the title [#191] 최초 로그인이 되어도 자동으로 로그아웃 되는 현상을 해결한다 [#191] 최초 로그인 시 자동으로 로그아웃 되는 현상을 해결한다 Mar 5, 2026
@opficdev opficdev merged commit 1f53f66 into develop Mar 5, 2026
1 check passed
@opficdev opficdev deleted the fix/#191-auto-logout branch March 5, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

소셜 로그인이 되고, 자동으로 로그아웃 되는 현상을 해결한다

1 participant