# getToken method Null safety

1. @override

Future<OAuthToken?> getToken()
override

저장되어 있는 `OAuthToken` 반환

## Implementation

    @override
    Future<OAuthToken?> getToken() async {
      if (_currentToken != null) {
        return _currentToken;
      }

      _encryptor ??= await AESCipher.create();
      _preferences ??= await SharedPreferences.getInstance();
      var version = _preferences!.getString(versionKey);
      var jsonToken = _preferences!.getString(tokenKey);

      if (jsonToken == null || version == null) {
        _currentToken = await _migrateOldToken();
      } else {
        _currentToken =
            OAuthToken.fromJson(jsonDecode(_encryptor!.decrypt(jsonToken)));
      }
      return _currentToken;
    }