File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export const zhCN = {
4747 weekendDesc : '默认隐藏周六日,如有周末课程或需展示可开启。' ,
4848 weekendOn : '显示周末' ,
4949 weekendOff : '隐藏周末' ,
50- languageLabel : '界面语言 ' ,
50+ languageLabel : '语言 ' ,
5151 languageDesc : '切换 UI 语言,立刻生效。' ,
5252 languageOptions : {
5353 auto : '自动(跟随系统/插件)' ,
@@ -926,7 +926,7 @@ export const zhCN = {
926926 currentTerm : '当前学期:{term}' ,
927927 storageTitle : '当前设置快照' ,
928928 storageDescription : '以下是当前浏览器存储的偏好设置,供参考或调试。' ,
929- storageLanguage : '界面语言 :{locale}' ,
929+ storageLanguage : '语言 :{locale}' ,
930930 storageTheme : '主题:{theme}' ,
931931 storagePagination : '分页:{mode},每页 {size} 条,邻近 {neighbors} 页' ,
932932 storageSelectionMode : '选课模式:{mode}' ,
@@ -1186,7 +1186,7 @@ export const zhCN = {
11861186 progress : '步骤 {current}/{total}' ,
11871187 termLabel : '学期:{term}' ,
11881188 language : {
1189- body : '请选择界面语言 。' ,
1189+ body : '请选择语言 。' ,
11901190 hint : '选择“自动”会跟随系统语言。你也可以在设置中随时修改。' ,
11911191 options : {
11921192 auto : '自动' ,
Original file line number Diff line number Diff line change @@ -31,6 +31,18 @@ function getOauthProxyUrl() {
3131 }
3232}
3333
34+ function normalizeRedirectUri ( value : string ) {
35+ try {
36+ const url = new URL ( value ) ;
37+ url . hash = '' ;
38+ url . search = '' ;
39+ const pathname = url . pathname . replace ( / \/ + $ / , '' ) ;
40+ return `${ url . origin } ${ pathname } ` ;
41+ } catch {
42+ return String ( value || '' ) . replace ( / \/ + $ / , '' ) ;
43+ }
44+ }
45+
3446export function getGithubPkceAvailability ( ) : GithubPkceAvailability {
3547 if ( ! browser ) return { supported : false , reason : 'unsupportedRuntime' } ;
3648 const clientId = publicEnv . PUBLIC_GITHUB_CLIENT_ID ;
@@ -147,7 +159,7 @@ export async function completeGithubPkceCallback(url: URL): Promise<GithubPkceCa
147159
148160 const availability = getGithubPkceAvailability ( ) ;
149161 if ( ! availability . supported ) return { ok : false , errorKey : 'errors.githubPkceUnsupported' } ;
150- if ( availability . redirectUri !== session . redirectUri ) {
162+ if ( normalizeRedirectUri ( availability . redirectUri ) !== normalizeRedirectUri ( session . redirectUri ) ) {
151163 return { ok : false , errorKey : 'errors.githubStateValidation' } ;
152164 }
153165
You can’t perform that action at this time.
0 commit comments