Skip to content

Commit f87b04f

Browse files
committed
fix: issue with algorithm drop down default value
1 parent 5e1be1a commit f87b04f

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

frontend/src/app/generate-token/generate-token.component.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ <h1 class="mb-5 heading">{{ "generate-token.create" | transloco }}</h1>
88
</p>
99

1010
<form #postForm="ngForm" (ngSubmit)="onCreateToken(postForm.value)">
11-
<select ngModel name="algo" class="rectangle">
12-
<option selected>HS256</option>
13-
<option>RS256</option>
11+
<select [(ngModel)]="algo" name="algo" class="rectangle">
12+
<option>HS256</option>
13+
<option [selected]="true">RS256</option>
1414
<option>ES256</option>
1515
</select>
1616

17-
<p class="font-grey algo">{{"generate-token.data" | transloco}}</p>
17+
<p class="font-grey algo">{{"generate-token.data" | transloco}}</p>
1818

1919
<textarea [(ngModel)]="payloadValue" name="payload" class="rectangle-1 data1"></textarea>
2020

@@ -32,7 +32,7 @@ <h1 class="mb-5 heading">{{ "generate-token.create" | transloco }}</h1>
3232

3333
<div class="row">
3434
<div class="col-auto text-end">
35-
<button type="submit" (click)="nextStep()" class="btn btn-warning mt-5" innerHTML="{{ 'generate-token.generateToken' | transloco }}"></button>
35+
<button type="submit" class="btn btn-warning mt-5" innerHTML="{{ 'generate-token.generateToken' | transloco }}"></button>
3636
</div>
3737
</div>
3838
</form>

frontend/src/app/generate-token/generate-token.component.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { StepService } from '../shared/services/step.service';
1111
export class GenerateTokenComponent implements OnInit {
1212

1313
payloadValue = '{ "data" : "We raised series A" }'
14+
algo ="RS256"
1415

1516
@Input() token = ""
1617

@@ -24,18 +25,19 @@ export class GenerateTokenComponent implements OnInit {
2425
}
2526

2627
onCreateToken(postData: {algo: string, payload: string}){
28+
console.log("Creating token for: "+JSON.stringify(postData));
2729
this.jwtService.post(postData).subscribe({
2830
next: (success: any)=>{
2931
this.token = success.token
30-
localStorage.setItem('token', this.token)
32+
localStorage.setItem('token', this.token);
33+
this.nextStep();
3134
}, error: (error: any) => {
3235
console.error('error:', error);
3336
},
3437
})
3538
}
3639

3740
nextStep(){
38-
this.onCreateToken
3941
this.stepService.setStep(5)
4042
this.router.navigate(['generate-token1'])
4143
}

frontend/src/app/jwtuses/jwtuses.component.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ <h1 class="mb-5 heading">{{ "jwtusedfor.usedFor" | transloco }}</h1>
3434
<img src="assets/images/icon-crog.svg" class="me-2" />
3535
{{ "jwtusedfor.leverage3" | transloco }}
3636
<br>
37-
{{"jwtusedfor.leverage4" | transloco}}
37+
<!--{{"jwtusedfor.leverage4" | transloco}}-->
38+
<!--Include a drawing here to make it easier to understand-->
3839
</p>
3940

4041
<p class="font-grey">{{"jwtusedfor.introduction3" | transloco}}</p>

0 commit comments

Comments
 (0)