refactor: Synology SSO 개선 및 불필요한 로그인 API 정리
- Synology 버튼: '오솔NAS로 로그인'으로 변경
- 이메일 매칭: {username}@osolit.net으로 매칭
- 삭제된 API:
- login.post.ts (이메일+이름 로그인)
- recent-users.get.ts (최근 로그인 사용자)
- select-user.post.ts (사용자 선택 로그인)
This commit is contained in:
@@ -17,7 +17,6 @@ onMounted(async () => {
|
||||
const hash = window.location.hash.substring(1)
|
||||
const params = new URLSearchParams(hash)
|
||||
const accessToken = params.get('access_token')
|
||||
const state = params.get('state')
|
||||
const error = params.get('error')
|
||||
|
||||
if (error) {
|
||||
@@ -32,11 +31,16 @@ onMounted(async () => {
|
||||
|
||||
try {
|
||||
// 서버로 access_token 전송하여 로그인 처리
|
||||
await $fetch('/api/auth/synology/verify', {
|
||||
const result = await $fetch<{ success: boolean; needPasswordSet?: boolean }>('/api/auth/synology/verify', {
|
||||
method: 'POST',
|
||||
body: { accessToken, state }
|
||||
body: { accessToken }
|
||||
})
|
||||
router.push('/')
|
||||
|
||||
if (result.needPasswordSet) {
|
||||
router.push('/set-password?from=synology')
|
||||
} else {
|
||||
router.push('/')
|
||||
}
|
||||
} catch (e: any) {
|
||||
router.push(`/login?error=${encodeURIComponent(e.data?.message || 'Synology 로그인에 실패했습니다.')}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user