Create private file with JWT

This commit is contained in:
wiecktobi 2020-05-25 23:20:23 +02:00
parent 881d01535d
commit 6907710f51

View File

@ -1,6 +1,7 @@
package de.hft.geotracker.activities package de.hft.geotracker.activities
import android.Manifest import android.Manifest
import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.os.Bundle import android.os.Bundle
@ -84,6 +85,9 @@ class Login : AppCompatActivity() {
var headers = response.headers() var headers = response.headers()
var authentication = headers.get("Authorization") var authentication = headers.get("Authorization")
openFileOutput("JWToken", Context.MODE_PRIVATE).use {
it.write(authentication!!.toByteArray())
}
token = JWToken(authentication!!) token = JWToken(authentication!!)
println(response.code()) println(response.code())
println(token.token) println(token.token)