Skip to content

Commit 68bb3a9

Browse files
committed
token_as_constant
1 parent 1eda98f commit 68bb3a9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sheets/test/application_flow.e

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ feature {NONE} -- Initialization
2222
create last_token.make_empty
2323
get_token
2424
if last_token.token.is_empty then
25-
logger.write_warning ("retrieve_access_token-> There is something wrong token is empty")
25+
logger.write_warning ("retrieve_access_token-> There is something wrong token is empty from file_path: " + Token_file_path_s)
2626
check
2727
not_happening: False
2828
end
@@ -39,7 +39,7 @@ feature {NONE} -- Initialization
3939
l_date_now: DATE_TIME
4040
l_diff: INTEGER_64
4141
do
42-
create {PLAIN_TEXT_FILE} file.make_with_name ("token.access")
42+
create {PLAIN_TEXT_FILE} file.make_with_name (Token_file_path_s)
4343
if file.exists then
4444
file.open_read
4545
file.read_stream (file.count)
@@ -97,7 +97,7 @@ feature {NONE} -- Initialization
9797
end
9898

9999
if attached api_service.access_token_post (empty_token, create {OAUTH_VERIFIER}.make (io.last_string)) as access_token then
100-
create {PLAIN_TEXT_FILE} file.make_create_read_write ("token.access")
100+
create {PLAIN_TEXT_FILE} file.make_create_read_write (Token_file_path_s)
101101
file.put_string (serialize (access_token))
102102
Result := access_token
103103
file.flush
@@ -137,7 +137,7 @@ feature {NONE} -- Initialization
137137
if attached request.execute as l_response then
138138
if attached l_response.body as l_body then
139139
if attached {OAUTH_TOKEN} google.access_token_extractor.extract (l_body) as l_access_token then
140-
create {PLAIN_TEXT_FILE} file.make_create_read_write ("token.access")
140+
create {PLAIN_TEXT_FILE} file.make_create_read_write (Token_file_path_s)
141141
file.put_string (serialize (l_access_token))
142142
Result := l_access_token
143143
file.flush
@@ -148,6 +148,10 @@ feature {NONE} -- Initialization
148148
end
149149
end
150150

151+
feature -- Access
152+
153+
Token_file_path_s: STRING = "token.access"
154+
151155
feature -- Status Setting
152156

153157
set_from_json_credentials_file_path (an_fp: PATH)

0 commit comments

Comments
 (0)