diff --git a/.gitignore b/.gitignore index 6fbee01..5202828 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ resources/css/styles.css resources/css/styles.css.map public/assets package-lock.json + +public/public_apps diff --git a/app/Controllers/Http/StoreController.ts b/app/Controllers/Http/StoreController.ts index 7394ad2..3e1dc04 100644 --- a/app/Controllers/Http/StoreController.ts +++ b/app/Controllers/Http/StoreController.ts @@ -174,7 +174,7 @@ export default class StoreController { if (erase !== undefined) response.redirect('/store/myapps') else - response.redirect('/store/apps') + response.redirect('/store') console.log('Starting folder upload') diff --git a/app/Middleware/SilentAuth.ts b/app/Middleware/SilentAuth.ts index f3ccfd3..21ddf70 100644 --- a/app/Middleware/SilentAuth.ts +++ b/app/Middleware/SilentAuth.ts @@ -1,4 +1,5 @@ import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' +import { UserType } from 'App/Models/User' /** * Silent auth middleware can be used as a global middleware to silent check @@ -10,12 +11,14 @@ export default class SilentAuthMiddleware { /** * Handle request */ - public async handle ({ auth }: HttpContextContract, next: () => Promise) { + public async handle({ auth, view }: HttpContextContract, next: () => Promise) { /** * Check if user is logged-in or not. If yes, then `ctx.auth.user` will be * set to the instance of the currently logged in user. */ await auth.check() + + view.share({ admin: auth.user?.type == UserType.ADMIN, user: auth.user }) await next() } } diff --git a/resources/views/store/store_container.edge b/resources/views/store/store_container.edge index 28ec9b1..0d475e4 100644 --- a/resources/views/store/store_container.edge +++ b/resources/views/store/store_container.edge @@ -15,7 +15,8 @@ Store
-
+
Catégories
Toutes Productivité @@ -24,21 +25,21 @@ Store Jeux Multimédia Autres - + @if (user) - Mon Compte - Mon Appareil - Mes Applications + Mon Compte + + Mes Applications @else - Connexion + Connexion @end -
+
{{{ await $slots.main() }}}
-
+
@endsection \ No newline at end of file