QNH-313 FE - Logout Action - #18
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implementasi fitur logout menggunakan Laravel Sanctum cookie-based session sesuai ADR-006 dan OpenAPI Contract v2.2.
User dapat mengakhiri sesi autentikasi melalui Logout Button yang tersedia pada aplikasi. Logout akan menghapus session autentikasi di backend, membersihkan state user di frontend, dan mengarahkan user kembali ke halaman login.
Jira Ticket
Ticket: QNH-313 FE - Logout Action
Type of Change
Changes Made
src/services/authService.ts* tambah methodlogout()implement requestPOST /logoutmenggunakan cookie-based sessionsrc/contexts/AuthContext.tsx* tambah fungsilogout, reset stateusermenjadinull, updateisAuthenticatedsecara otomatis melalui derived statesrc/components/** integrasikan Logout Button dengan AuthContext logout actionsrc/routes/** pastikan protected route melakukan redirect ke/loginsetelah logoutsrc/tests/** tambah/sesuaikan unit test logout flow, verifikasi state user dibersihkan setelah logout, verifikasi redirect setelah logout berhasilHow to Test
/dashboardPOST /logoutterkirim ke backend/login/loginScreenshots (if applicable)
Checklist