Google 계정 로그인 연동 추가

This commit is contained in:
2026-07-29 14:02:07 +09:00
parent 99af25b8fa
commit 52ed053876
20 changed files with 897 additions and 9 deletions

View File

@@ -0,0 +1,11 @@
import test from 'node:test'
import assert from 'node:assert/strict'
import { normalizeGoogleOAuthRedirect } from '../server/utils/google-oauth.js'
test('Google OAuth redirect는 내부 경로만 허용한다', () => {
assert.equal(normalizeGoogleOAuthRedirect('/settings', '/'), '/settings')
assert.equal(normalizeGoogleOAuthRedirect('/admin?google=linked', '/'), '/admin?google=linked')
assert.equal(normalizeGoogleOAuthRedirect('https://example.com', '/'), '/')
assert.equal(normalizeGoogleOAuthRedirect('//example.com', '/'), '/')
assert.equal(normalizeGoogleOAuthRedirect('/\\evil', '/'), '/')
})