File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 1
1
<!DOCTYPE html>
2
2
< html >
3
3
4
- < body >
5
- < div style ="display: flex;flex-direction: column; ">
4
+ < body style ="padding: 3.5rem;display: flex;justify-content: center; ">
5
+ < div
6
+ style ="display: flex;flex-direction: column;padding: 4rem;max-width: 56rem;gap: 0.5rem;border: 1px solid;border-color: dimgray;border-radius: 0.5rem;align-items: center; ">
7
+ < h2 style ="align-self: flex-start; "> Sign in with JIA</ h2 >
6
8
< label >
7
9
ユーザー名
8
10
< input id ="user ">
11
13
パスワード
12
14
< input id ="password " type ="password ">
13
15
</ label >
14
- < button id ="login "> login</ button >
16
+ < button id ="login "
17
+ style ="margin-top: 1.5rem;background-color: transparent;border-color: dimgray;cursor: pointer;outline: none;padding: 0.1rem;width: 5rem;appearance: none;border-radius: 8px; "> login</ button >
15
18
</ div >
16
19
</ body >
17
20
< script >
24
27
headers : { 'Content-Type' : 'application/json' } ,
25
28
body : JSON . stringify ( { user : userEl . value , password : passwordEl . value } )
26
29
} ) . then ( v => {
30
+ if ( ! v . ok ) {
31
+ alert ( 'ユーザー名かパスワードが間違っています' )
32
+ throw ''
33
+ }
27
34
console . log ( v )
28
35
v . text ( ) . then ( jwt => {
29
36
console . log ( jwt )
30
- location . href = `http://localhost:3000 ?jwt=${ jwt } `
37
+ location . href = `${ document . referrer } ?jwt=${ jwt } `
31
38
} )
32
39
} )
33
40
} )
You can’t perform that action at this time.
0 commit comments