diff --git a/Advanced b/Advanced new file mode 100644 index 00000000..e69de29b diff --git a/Autofill b/Autofill new file mode 100644 index 00000000..e69de29b diff --git a/Languages b/Languages new file mode 100644 index 00000000..e69de29b diff --git a/System b/System new file mode 100644 index 00000000..e69de29b diff --git a/backend/controllers/authController.js b/backend/controllers/authController.js index d792ec5c..593db0dc 100644 --- a/backend/controllers/authController.js +++ b/backend/controllers/authController.js @@ -27,8 +27,8 @@ const activate = async (req, res, next) => { const loginUser = async (req, res, next) => { try { - const { email, password } = req.body; - const result = await login(email, password); + const { email, password, rememberMe } = req.body; + const result = await login(email, password, { rememberMe }); res.status(200).json(result); } catch (error) { next(error); @@ -37,7 +37,7 @@ const loginUser = async (req, res, next) => { const logoutUser = async (req, res, next) => { try { - const token = req.headers['authorization']?.split(' ')[1]; + const token = req.headers['authorization']?.split(' ')[1] || req.headers.authcode; const result = await logout(token); res.status(200).json(result); } catch (error) { diff --git a/backend/services/authService.js b/backend/services/authService.js index e81c3377..4aebfcd3 100644 --- a/backend/services/authService.js +++ b/backend/services/authService.js @@ -65,7 +65,7 @@ const activateUser = async (activationCode) => { return user; }; -const login = async (email, password) => { +const login = async (email, password, options = {}) => { if (!email || !password) { const err = new Error('Email und Passwort sind erforderlich.'); err.status = 400; @@ -83,13 +83,17 @@ const login = async (email, password) => { err.status = 403; throw err; } - const token = jwt.sign({ userId: user.id }, process.env.JWT_SECRET, { expiresIn: '3h' }); + const rememberMe = Boolean(options.rememberMe); + const expiresInMs = rememberMe ? 90 * 24 * 3600 * 1000 : 3 * 3600 * 1000; + const expiresIn = rememberMe ? '90d' : '3h'; + const expiresAt = new Date(Date.now() + expiresInMs); + const token = jwt.sign({ userId: user.id }, process.env.JWT_SECRET, { expiresIn }); await UserToken.create({ userId: user.id, token, - expiresAt: new Date(Date.now() + 3 * 3600 * 1000), + expiresAt, }); - return { token }; + return { token, expiresAt: expiresAt.toISOString() }; }; const logout = async (token) => { diff --git a/mobile-app/composeApp/playstore/ic_launcher_foreground_512.png b/mobile-app/composeApp/playstore/ic_launcher_foreground_512.png new file mode 100644 index 00000000..e01d6e74 Binary files /dev/null and b/mobile-app/composeApp/playstore/ic_launcher_foreground_512.png differ diff --git a/mobile-app/composeApp/release/composeApp-release.aab b/mobile-app/composeApp/release/composeApp-release.aab index 5044ef8d..04d4b82f 100644 Binary files a/mobile-app/composeApp/release/composeApp-release.aab and b/mobile-app/composeApp/release/composeApp-release.aab differ diff --git a/mobile-app/composeApp/src/androidMain/res/drawable-hdpi/ic_launcher_foreground.png b/mobile-app/composeApp/src/androidMain/res/drawable-hdpi/ic_launcher_foreground.png index 30633602..3fad60a1 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/drawable-hdpi/ic_launcher_foreground.png and b/mobile-app/composeApp/src/androidMain/res/drawable-hdpi/ic_launcher_foreground.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/drawable-mdpi/ic_launcher_foreground.png b/mobile-app/composeApp/src/androidMain/res/drawable-mdpi/ic_launcher_foreground.png index b3c84d04..b2c28771 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/drawable-mdpi/ic_launcher_foreground.png and b/mobile-app/composeApp/src/androidMain/res/drawable-mdpi/ic_launcher_foreground.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/drawable-xhdpi/ic_launcher_foreground.png b/mobile-app/composeApp/src/androidMain/res/drawable-xhdpi/ic_launcher_foreground.png index 7133962b..82c4f6ee 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/drawable-xhdpi/ic_launcher_foreground.png and b/mobile-app/composeApp/src/androidMain/res/drawable-xhdpi/ic_launcher_foreground.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/drawable-xxhdpi/ic_launcher_foreground.png b/mobile-app/composeApp/src/androidMain/res/drawable-xxhdpi/ic_launcher_foreground.png index 314f8fca..b910e84d 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/drawable-xxhdpi/ic_launcher_foreground.png and b/mobile-app/composeApp/src/androidMain/res/drawable-xxhdpi/ic_launcher_foreground.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/drawable-xxxhdpi/ic_launcher_foreground.png b/mobile-app/composeApp/src/androidMain/res/drawable-xxxhdpi/ic_launcher_foreground.png index 78735911..d88b5e06 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/drawable-xxxhdpi/ic_launcher_foreground.png and b/mobile-app/composeApp/src/androidMain/res/drawable-xxxhdpi/ic_launcher_foreground.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png b/mobile-app/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png index cc227bc3..72ce161c 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png and b/mobile-app/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png b/mobile-app/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png index cc227bc3..72ce161c 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png and b/mobile-app/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png b/mobile-app/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png index 3d4a0ce1..bae48aa2 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png and b/mobile-app/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png b/mobile-app/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png index 3d4a0ce1..bae48aa2 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png and b/mobile-app/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png b/mobile-app/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png index 88cc0c67..6f1bd959 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png and b/mobile-app/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png b/mobile-app/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png index 88cc0c67..6f1bd959 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png and b/mobile-app/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png b/mobile-app/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png index 711d3b97..1a2dec12 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png and b/mobile-app/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png b/mobile-app/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png index 711d3b97..1a2dec12 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png and b/mobile-app/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png b/mobile-app/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png index 191ee649..edcc4b44 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png and b/mobile-app/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/mobile-app/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png b/mobile-app/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png index 191ee649..edcc4b44 100644 Binary files a/mobile-app/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png and b/mobile-app/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/mobile-app/gradle/libs.versions.toml b/mobile-app/gradle/libs.versions.toml index 3c61752e..2e5a5382 100644 --- a/mobile-app/gradle/libs.versions.toml +++ b/mobile-app/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] # composeApp (Play Store / „Über die App“-Build) -appVersionCode = "9" -appVersionName = "1.3.3" +appVersionCode = "11" +appVersionName = "1.4.1" agp = "9.2.1" android-compileSdk = "35" android-minSdk = "24" diff --git a/mobile-app/scripts/refresh-android-launcher-icons.sh b/mobile-app/scripts/refresh-android-launcher-icons.sh index 032b7a15..8bc5fe87 100755 --- a/mobile-app/scripts/refresh-android-launcher-icons.sh +++ b/mobile-app/scripts/refresh-android-launcher-icons.sh @@ -16,6 +16,9 @@ magick "$SRC" -resize 162x162! -filter Lanczos "$RES/drawable-hdpi/ic_launcher magick "$SRC" -resize 216x216! -filter Lanczos "$RES/drawable-xhdpi/ic_launcher_foreground.png" magick "$SRC" -resize 324x324! -filter Lanczos "$RES/drawable-xxhdpi/ic_launcher_foreground.png" magick "$SRC" -resize 432x432! -filter Lanczos "$RES/drawable-xxxhdpi/ic_launcher_foreground.png" +# Erzeuge zusätzlich ein 512x512 PNG für den Play Store (Upload-Icon) +mkdir -p "$ROOT/mobile-app/composeApp/playstore" +magick "$SRC" -resize 512x512! -filter Lanczos "$ROOT/mobile-app/composeApp/playstore/ic_launcher_foreground_512.png" magick "$SRC" -resize 48x48! -filter Lanczos "$RES/mipmap-mdpi/ic_launcher.png" magick "$SRC" -resize 72x72! -filter Lanczos "$RES/mipmap-hdpi/ic_launcher.png" magick "$SRC" -resize 96x96! -filter Lanczos "$RES/mipmap-xhdpi/ic_launcher.png" diff --git a/mobile-app/shared/src/commonMain/kotlin/de/tsschulz/tt_tagebuch/shared/api/AuthApi.kt b/mobile-app/shared/src/commonMain/kotlin/de/tsschulz/tt_tagebuch/shared/api/AuthApi.kt index 3d7178c8..ce07e911 100644 --- a/mobile-app/shared/src/commonMain/kotlin/de/tsschulz/tt_tagebuch/shared/api/AuthApi.kt +++ b/mobile-app/shared/src/commonMain/kotlin/de/tsschulz/tt_tagebuch/shared/api/AuthApi.kt @@ -12,7 +12,7 @@ class AuthApi( ) { suspend fun login(email: String, password: String): LoginResponse { return client.http.post("/api/auth/login") { - setBody(LoginRequest(email = email, password = password)) + setBody(LoginRequest(email = email, password = password, rememberMe = true)) }.body() } @@ -20,4 +20,3 @@ class AuthApi( client.http.post("/api/auth/logout") } } - diff --git a/mobile-app/shared/src/commonMain/kotlin/de/tsschulz/tt_tagebuch/shared/api/models/LoginRequest.kt b/mobile-app/shared/src/commonMain/kotlin/de/tsschulz/tt_tagebuch/shared/api/models/LoginRequest.kt index 489f4e98..30f6342e 100644 --- a/mobile-app/shared/src/commonMain/kotlin/de/tsschulz/tt_tagebuch/shared/api/models/LoginRequest.kt +++ b/mobile-app/shared/src/commonMain/kotlin/de/tsschulz/tt_tagebuch/shared/api/models/LoginRequest.kt @@ -6,5 +6,5 @@ import kotlinx.serialization.Serializable data class LoginRequest( val email: String, val password: String, + val rememberMe: Boolean = false, ) -