Skip to content

Commit 5a5a90b

Browse files
committed
Fix login page
1 parent a35d1d6 commit 5a5a90b

File tree

4 files changed

+70
-16
lines changed

4 files changed

+70
-16
lines changed

package-lock.json

+63-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
"name": "les-projets-cagnottes",
3-
"version": "0.9.1",
3+
"version": "0.9.2",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",
77
"build": "ng build",
88
"test": "ng test",
99
"lint": "ng lint",
1010
"e2e": "ng e2e",
11-
"int:extract": "ng extract-i18n --output-path src/locale"
11+
"int:extract": "ng extract-i18n --output-path src/locale",
12+
"prod:build": "ng build -- --configuration production --output-path=dist",
13+
"prod:run": "angular-http-server -p 4200 --path dist/fr"
1214
},
1315
"private": true,
1416
"dependencies": {
@@ -24,6 +26,7 @@
2426
"@angular/router": "^12.1.1",
2527
"@fortawesome/fontawesome-free": "^5.14.0",
2628
"admin-lte": "^3.1.0",
29+
"angular-http-server": "^1.10.0",
2730
"bootstrap": "^4.6.0",
2831
"core-js": "^3.15.2",
2932
"ionicons": "^5.5.2",

src/app/app-routing.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const routes: Routes = [
2727
{
2828
path: '', component: LesProjetsCagnottesComponent, canActivate: [AuthGuard],
2929
children: [
30-
{ path: '', redirectTo: '/projects%3Fstatus=in_progress', pathMatch: 'full' },
30+
{ path: '', redirectTo: '/news', pathMatch: 'full' },
3131
{ path: 'news/new', component: EditNewsComponent },
3232
{ path: 'news/:id/edit', component: EditNewsComponent },
3333
{ path: 'news', component: ListNewsComponent },

src/app/login/login.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class LoginComponent implements OnInit {
4040
this.redirectUrlOAuth = location.href.replace("/login", "/login/slack");
4141
}
4242
if(this.router.url.startsWith('/login/slack')) {
43-
this.redirectUrlOAuth = location.href.replace(/\?code.*/, "").replace(/&code.*/, "");
43+
this.redirectUrlOAuth = encodeURIComponent(location.href.replace(/\?code.*/, "").replace(/&code.*/, ""));
4444
this.code = this.route.snapshot.queryParams['code'];
4545
this.authenticationService.slack(this.code, this.redirectUrlOAuth)
4646
.subscribe(() => {

0 commit comments

Comments
 (0)